node.js express createServer() not a function

Change:

var express = require('express');
var app = module.exports = express.createServer();  

To:

var express = require('express');
var app = express();
//Middleware
app.listen(3000)

You can also globally install express with the following command and then automatically generate a express template with the following command:

npm install -g express

Generate template:

express myAppName
cd . && npm install

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)