From a429348c7d11fef96c5ba36560988de74df9319a Mon Sep 17 00:00:00 2001 From: hippoz Date: Sun, 22 Aug 2021 00:41:51 +0300 Subject: [PATCH] remove legacy handler and clean up index.js --- brainlet/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/brainlet/index.js b/brainlet/index.js index b4fdaee..5e09b63 100755 --- a/brainlet/index.js +++ b/brainlet/index.js @@ -1,18 +1,16 @@ const config = require("./config"); const apiRoute = require("./api/v1"); +const GatewayServerV2 = require("./api/v2/gateway/index"); const express = require("express"); const cookieParser = require("cookie-parser"); const cors = require("cors"); const http = require("http"); -const { authenticateEndpoint } = require("./common/auth/authfunctions"); -const GatewayServerV2 = require("./api/v2/gateway/index"); - const app = express(); const httpServer = http.createServer(app); -const gatewayv2 = new GatewayServerV2({ server: httpServer }); +new GatewayServerV2({ server: httpServer }); app.use(express.urlencoded({ extended: false })); app.use(express.json()); @@ -31,10 +29,6 @@ app.use(cors({ app.use("/api/v1", apiRoute); app.use(express.static("app")); -app.get("/", authenticateEndpoint((req, res) => { - res.redirect("/app.html"); -}, "/auth.html")); - app.use((err, req, res, next) => { console.error("[E] Internal server error", err); res.status(500).json({ error: true, status: 500, message: "ERR_INTERNAL_SERVER_ERROR" });