Add extras handler

This commit is contained in:
tgpethan 2019-11-23 20:33:53 +00:00
parent 3b891869b8
commit 70c48b1cce
3 changed files with 12 additions and 5 deletions

View File

@ -1,4 +1,6 @@
# Revolution
Revolution is a web server that I designed to be flexible to fit the needs of it's applications.
It is mainly used in my Screenshot server, EUS which was recently rewriten.
It's main design goal was to be modular.
<h1 align="center">
<img height="150" src="http://ethanus.ml/images/Revolution.png">
</h1>
<p align="center">Revolution is a web server that I designed to be flexible to fit the needs of it's applications.</p>
<p align="center">It is mainly used in my Screenshot server, EUS which was recently rewriten.</p>
<p align="center">It's main design goal was to be modular.</p>

View File

@ -1,5 +1,4 @@
const express = require("express"),
app = express(),
fs = require("fs"),
chalk = require("chalk"),
config = require("./config/config.json"),
@ -8,6 +7,7 @@ global.actualDir = __dirname;
global.internals = {
version:"Open Source",
};
global.app = express();
global.modules = [];
let dE = new Date(),
startTime = dE.getTime(),
@ -53,6 +53,7 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
});
function server() {
reqhandler.extras();
app.get('*', (req, res) => reqhandler.get(req, res));
app.post('*', (req, res) => reqhandler.post(req, res));
app.listen(config.server.port, () => {

View File

@ -17,6 +17,10 @@ if (!fs.existsSync(__dirname + BASE_PATH + "/files")) {
}
module.exports = {
extras:function() {
// Anything else that is needed like busboy
// Put them to global.app (the express app)
},
get:function(req, res) {
/*
req - Request from client