What is the difference between require() and require()()?
I have a code:
Not working
var app = require('express');
var http = require('http').Server(app);
app.get('/', (req, res) => {
res.send('Hello World');
});
Working
var app = require('express')();
var http = require('http').Server(app);
app.get('/', (req, res) => {
res.send('Hello World');
});
Why?