Compare commits

..

No commits in common. "847950c726ecc0a3c69fc5b23b5e628d618bca48" and "a4e44fe8843bcc06131f2a51156cb1107ee95e59" have entirely different histories.

5 changed files with 0 additions and 60 deletions

1
.gitignore vendored
View File

@ -7,4 +7,3 @@
!/package-lock.json
!/README.md
!/files/www/qonq.js
!/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

50
package-lock.json generated
View File

@ -9,7 +9,6 @@
"dotenv": "^10.0.0",
"express": "^4.17.1",
"formidable": "^1.2.2",
"serve-favicon": "^2.5.0",
"serve-index": "^1.9.1"
}
},
@ -446,31 +445,6 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"node_modules/serve-favicon": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.5.0.tgz",
"integrity": "sha1-k10kDN/g9YBTB/3+ln2IlCosvPA=",
"dependencies": {
"etag": "~1.8.1",
"fresh": "0.5.2",
"ms": "2.1.1",
"parseurl": "~1.3.2",
"safe-buffer": "5.1.1"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/serve-favicon/node_modules/ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"node_modules/serve-favicon/node_modules/safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
},
"node_modules/serve-index": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
@ -916,30 +890,6 @@
}
}
},
"serve-favicon": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.5.0.tgz",
"integrity": "sha1-k10kDN/g9YBTB/3+ln2IlCosvPA=",
"requires": {
"etag": "~1.8.1",
"fresh": "0.5.2",
"ms": "2.1.1",
"parseurl": "~1.3.2",
"safe-buffer": "5.1.1"
},
"dependencies": {
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
}
}
},
"serve-index": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",

View File

@ -4,7 +4,6 @@
"dotenv": "^10.0.0",
"express": "^4.17.1",
"formidable": "^1.2.2",
"serve-favicon": "^2.5.0",
"serve-index": "^1.9.1"
}
}

View File

@ -3,7 +3,6 @@ var colors = require("colors");
var express = require("express");
var formidable = require("formidable");
var serveIndex = require("serve-index");
var serveFavicon = require("serve-favicon");
var path = require("path");
var fs = require("fs");
@ -28,8 +27,6 @@ app.use((req, res, next)=>{
next();
});
app.use(serveFavicon("favicon.ico"));
app.post("*", (req, res, next) => {
if (req.headers.authentication != process.env.AUTH_TOKEN) return void res.status(403).send("Unauthorized");
@ -85,8 +82,3 @@ app.get(['/', '/:code/', '/:code/*'], function(req, res, next){
});
}, express.static(FILES_DIR), serveIndex(FILES_DIR, {icons: true}));
app.use((req, res) => {
if (req.method == "GET") res.status(404).send("This resource does not exist.");
else res.sendStatus(405);
});