Add comments to the framework & included modules #16
1 changed files with 8 additions and 6 deletions
14
index.js
14
index.js
|
@ -61,6 +61,13 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
|
||||||
if (files[i].includes(".js")) {
|
if (files[i].includes(".js")) {
|
||||||
console.log(`[Modules] Found module ${files[i].toString()}`);
|
console.log(`[Modules] Found module ${files[i].toString()}`);
|
||||||
global.modules[files[i].toString().replace(".js", "")] = require(`./modules/${files[i].toString()}`);
|
global.modules[files[i].toString().replace(".js", "")] = require(`./modules/${files[i].toString()}`);
|
||||||
|
|
||||||
|
// We want to find out what the request handler module is
|
||||||
|
if (global.modules[files[i].toString().replace(".js", "")].MOD_FUNC == "handle_requests") {
|
||||||
|
// Set reqhandler to the request handler for easy getting
|
||||||
|
reqhandler = global.modules[files[i].toString().replace(".js", "")];
|
||||||
|
}
|
||||||
|
|
||||||
// Loop through and set the required modules flags
|
// Loop through and set the required modules flags
|
||||||
for (var i1 = 0; i1 < requiredModules.length; i1++) {
|
for (var i1 = 0; i1 < requiredModules.length; i1++) {
|
||||||
// Check if this module is a required module
|
// Check if this module is a required module
|
||||||
|
@ -69,11 +76,6 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
|
||||||
requiredModules[i1].status = true;
|
requiredModules[i1].status = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We want to find out what the request handler module is
|
|
||||||
if (global.modules[files[i].toString().replace(".js", "")].MOD_FUNC == "handle_requests") {
|
|
||||||
// Set reqhandler to the request handler for easy getting
|
|
||||||
reqhandler = global.modules[files[i].toString().replace(".js", "")];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// File is not a .js file (module)
|
// File is not a .js file (module)
|
||||||
// Make sure the file is not a directory
|
// Make sure the file is not a directory
|
||||||
|
@ -102,7 +104,7 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
|
||||||
} else {
|
} else {
|
||||||
// All required modules are found, start the framework's server.
|
// All required modules are found, start the framework's server.
|
||||||
global.modules.consoleHelper.printInfo(emoji.wave, "Starting Revolution...");
|
global.modules.consoleHelper.printInfo(emoji.wave, "Starting Revolution...");
|
||||||
server();
|
frameworkServer();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue