I'm trying to put my server with its variables inside an object in order to keep my project clean, so I've created core.js file, which holds all server variables and looks like this:
module.exports =
{
express: require('express'),
http: require("http"),
app: this.express(),
server: this.http.createServer(this.app),
io: require('socket.io').listen(this.server),
runServer: function()
{
...........
}
};
I require this file inside my main file:
var core = require("./server/classes/core");
And when I try to run I get this error:
app: this.express(),
^
TypeError: this.express is not a function
What could possibly be the problem?