Working with Node 12.16.1 I can't seem to call the createServer
method from the http
module in IntelliJ. Also, I'm a noob (2nd post on stackoverflow) so I'm sure there is something really basic I'm missing. The first step toward learning from my mistakes is identifying them so your help is appreciated.
I know createServer is no longer used in Express 4, but it still shows as being a current method for the http Node 12.16.1 documentation online:
https://nodejs.org/dist/latest-v12.x/docs/api/http.html https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_createserver_options_requestlistener
So when I start a file with
var http = require('http');
I figure I should be able to see createServer
as an available method when I enter:
http.
I know there are other ways to create a server using express 4 and coding a function, so I'm not trying to figure out how to enable a server. I want to better understand the behavior of modules and methods and installing them. I have run into "missing methods" from node a couple of times and have usually found a work around.
This time I want to better understand the reason I'm not finding the method in my IDE. Is it deprecated? Is there something I need to configure differently? I have tried
npm install http
a couple of times and still don't find the method. The module call is recognized and numerous methods are available. Again I'm a noob and just looking to learn / understand this behavior. Any help is appreciated.
Thanks