From 742f9a1ddef62b10c829fb7104b331358276a487 Mon Sep 17 00:00:00 2001 From: tgpethan Date: Sat, 4 Jan 2020 12:30:27 +0000 Subject: [PATCH] Rephrase and add comments to example_request_handler --- modules/example_request_handler.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/example_request_handler.js b/modules/example_request_handler.js index b06f418..f5a84de 100644 --- a/modules/example_request_handler.js +++ b/modules/example_request_handler.js @@ -20,14 +20,20 @@ if (!fs.existsSync(__dirname + BASE_PATH + "/files")) { module.exports = { extras:async function() { - // Anything else that is needed like busboy - // Put them to global.app (the express app) + /* + Anything else that needs to be loaded into the framework + can be done here, this is used for things like busboy that + need to be put to the express server to work + The express server is accessable from global.app + */ }, get:async function(req, res) { /* req - Request from client res - Response from server */ + + // Anything that needs to be done in a GET request can be done here // Make sure the file exists fs.access(__dirname + BASE_PATH + "/files" + req.url, fs.F_OK, error => { @@ -48,7 +54,7 @@ module.exports = { res - Response from server */ - // Anything that needs to be done with a post can be done here. + // Anything that needs to be done with a POST can be done here. } }