Quantcast
Channel: Why we pass "app" in http.createServer(app) - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Why we pass "app" in http.createServer(app)

$
0
0

Why we pass "app" in http.createServer(app) as we can also pass

e.g :

var app = require('./app')const http = require('http')const port = 3500 || process.env.PORTvar server = http.createServer(app) //here we pass app

in other code we pass some different argument such as this

https.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/plain'});  res.write('Hello World!');  res.end();}).listen(port)

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>