lundi 13 février 2017

Node.js Express module exports

Vote count: 0

im getting this error

app.get is not a function

this is my config/express.js

var express = require('express');


    module.exports = function(){

    var app = express();

    app.set('port',3000);

    return app;

    };

and this is my server.js

var http = require ('http');

var app = require ('./config/express');


http.createServer(app).listen(app.get('port'), function(){

    console.log("Express Server Runing on port"+ app.get('port'));


});

what im doing wrong?

asked 49 secs ago

Let's block ads! (Why?)



Node.js Express module exports

Aucun commentaire:

Enregistrer un commentaire