diff options
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 55 |
1 files changed, 29 insertions, 26 deletions
@@ -29,37 +29,37 @@ const Hook = new webhook.Webhook(config.durl); const port = 4000; const logger = (req, res, next) => { - console.log( - `${req.protocol}://${req.get('host')}${ + console.log( + `${req.protocol}://${req.get('host')}${ req.originalUrl }: ${moment().format()}` - ); - next(); - }; + ); + next(); +}; - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout - }); +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); - rl.on("line", (input) => { - switch (input) { - case "clear": - console.clear(); +rl.on("line", (input) => { + switch (input) { + case "clear": + console.clear(); break; - case "exit": - async function exitWebsite() { + case "exit": + async function exitWebsite() { console.log("[i] Closing website..."); - await Hook.info("Alee Productions Website","Website is shutting down..."); + await Hook.info("Alee Productions Website", "Website is shutting down..."); process.exit(0); - } - exitWebsite(); + } + exitWebsite(); break; - default: - console.log("[X] Error: Command not found. Use clear or exit."); - break; - } - }); + default: + console.log("[X] Error: Command not found. Use clear or exit."); + break; + } +}); console.log("[i] Starting up Website...") @@ -71,13 +71,16 @@ app.use(express.static(path.join(__dirname, "public"))); app.use(logger) app.use("/", require("./routes/index")); +app.use("/projects", require("./routes/projects")); app.use("/about", require("./routes/about")); app.use((req, res) => { - res.status(404).render("404", {title: "404 | Alee Productions"}); + res.status(404).render("404", { + title: "404 | Alee Productions" + }); }); app.listen(port, () => { -//Hook.success("Alee Productions Website","Website has been loaded!") -console.log(`[>] Website listening on port ${port}!`) + //Hook.success("Alee Productions Website","Website has been loaded!") + console.log(`[>] Website listening on port ${port}!`) });
\ No newline at end of file |
