I have a routes.js file that looks like this.
return {
"GET" : {
"/" : renderHomePage
},
"POST" : {
"/ajax/addUser" : addUser
}
}
I am trying to include it in the main create server script so that I can access it directly inside the variable to call the functions.
var routes = require("routes.js");
var internalFunction = routes.GET["/"];
internalFunction();
It isn't working but I was wondering how I can do this?