↧
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 ArticleAnswer 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 ArticleWhy 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