Quantcast
Channel: Why we pass "app" in http.createServer(app) - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by john-raymon for Why we pass "app" in http.createServer(app)

Quoting the Express documentation:The app returned by express() is in fact a JavaScript Function, designed to be passed to Node’s HTTP servers as a callback to handle requests. This makes it easy to...

View Article


Answer by jfriend00 for Why we pass "app" in http.createServer(app)

In your first example, I'm assuming that app represents an Express instance from something like this:const app = express();If so, then app is a request handler function that also has properties. You...

View Article


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

Why we pass "app" in http.createServer(app) as we can also passe.g :var app = require('./app')const http = require('http')const port = 3500 || process.env.PORTvar server = http.createServer(app) //here...

View Article
Browsing latest articles
Browse All 3 View Live


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