Add extras handler
This commit is contained in:
parent
3b891869b8
commit
70c48b1cce
3 changed files with 12 additions and 5 deletions
10
README.md
10
README.md
|
@ -1,4 +1,6 @@
|
||||||
# Revolution
|
<h1 align="center">
|
||||||
Revolution is a web server that I designed to be flexible to fit the needs of it's applications.
|
<img height="150" src="http://ethanus.ml/images/Revolution.png">
|
||||||
It is mainly used in my Screenshot server, EUS which was recently rewriten.
|
</h1>
|
||||||
It's main design goal was to be modular.
|
<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>
|
||||||
|
|
3
index.js
3
index.js
|
@ -1,5 +1,4 @@
|
||||||
const express = require("express"),
|
const express = require("express"),
|
||||||
app = express(),
|
|
||||||
fs = require("fs"),
|
fs = require("fs"),
|
||||||
chalk = require("chalk"),
|
chalk = require("chalk"),
|
||||||
config = require("./config/config.json"),
|
config = require("./config/config.json"),
|
||||||
|
@ -8,6 +7,7 @@ global.actualDir = __dirname;
|
||||||
global.internals = {
|
global.internals = {
|
||||||
version:"Open Source",
|
version:"Open Source",
|
||||||
};
|
};
|
||||||
|
global.app = express();
|
||||||
global.modules = [];
|
global.modules = [];
|
||||||
let dE = new Date(),
|
let dE = new Date(),
|
||||||
startTime = dE.getTime(),
|
startTime = dE.getTime(),
|
||||||
|
@ -53,6 +53,7 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
|
||||||
});
|
});
|
||||||
|
|
||||||
function server() {
|
function server() {
|
||||||
|
reqhandler.extras();
|
||||||
app.get('*', (req, res) => reqhandler.get(req, res));
|
app.get('*', (req, res) => reqhandler.get(req, res));
|
||||||
app.post('*', (req, res) => reqhandler.post(req, res));
|
app.post('*', (req, res) => reqhandler.post(req, res));
|
||||||
app.listen(config.server.port, () => {
|
app.listen(config.server.port, () => {
|
||||||
|
|
|
@ -17,6 +17,10 @@ if (!fs.existsSync(__dirname + BASE_PATH + "/files")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
extras:function() {
|
||||||
|
// Anything else that is needed like busboy
|
||||||
|
// Put them to global.app (the express app)
|
||||||
|
},
|
||||||
get:function(req, res) {
|
get:function(req, res) {
|
||||||
/*
|
/*
|
||||||
req - Request from client
|
req - Request from client
|
||||||
|
|
Loading…
Reference in a new issue