diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-25 17:43:20 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-25 17:43:20 -0400 |
| commit | 69474fee32c62e1b97b9f51b78a2e242542ae9a7 (patch) | |
| tree | f03569672f62ad251a38d1deb5d46152f1b54207 /app.js | |
| parent | 379e44e7f1649ed2983e9167a7a4ac27303ed8d5 (diff) | |
| download | Project-NewTube-69474fee32c62e1b97b9f51b78a2e242542ae9a7.tar.gz Project-NewTube-69474fee32c62e1b97b9f51b78a2e242542ae9a7.tar.bz2 Project-NewTube-69474fee32c62e1b97b9f51b78a2e242542ae9a7.zip | |
Rewrite incoming
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 92 |
1 files changed, 0 insertions, 92 deletions
@@ -1,92 +0,0 @@ - /******************************************************************************* - * - * Project NewTube: A YouTube alternative. - * Copyright (C) 2019 Alee Productions Team. - * - * This software is protected by the copyright and licensing rights held - * by the Alee Productions Team. (2019) - * - *********************************************************************************/ -const express = require('express'); -const app = express(); -const moment = require('moment'); -const readline = require("readline"); -const path = require("path"); -//const config = require("./config.json"); -const mongoose = require('mongoose'); -const passport = require('passport'); -const flash = require('connect-flash'); -const session = require('express-session'); -//const Hook = new webhook.Webhook(config.durl); - -const port = 4000; - -const logger = (req, res, next) => { - console.log( - `${req.protocol}://${req.get('host')}${ - req.originalUrl - }: ${moment().format()}` - ); - next(); -}; - -const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); - -function rlHelp() { - console.log("-----------HELP---------"); - console.log("help - Displays help"); - console.log("clear - Clears the console"); - console.log("exit - Exits Application"); - console.log("------------------------"); -} - -rl.on("line", (input) => { - switch (input) { - case "help": - rlHelp(); - break; - case "clear": - console.clear(); - break; - case "exit": - async function exitWebsite() { - console.log("[i] Closing website..."); - //await Hook.info("Alee Productions Website", "Website is shutting down..."); - process.exit(0); - } - exitWebsite(); - break; - default: - console.log("[X] Error: Command not found. Type help."); - break; - } -}); - -console.log("[i] Starting up Website..."); - -// Views - -app.set('view engine', 'ejs'); - -app.set("views", path.join(__dirname, "views")); -app.use(express.static(path.join(__dirname, "public"))); - -app.use(logger); - -// Routes - -app.use("/", require("./routes/index")); - -app.use((req, res) => { - 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}!`); -});
\ No newline at end of file |
