From 5c494d7018b615112a8792231f70b4604ac04461 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Mon, 28 Mar 2022 22:28:34 +0200 Subject: [PATCH] Changed hosting path --- src/server/index.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index e04a38d..b1136cf 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -7,14 +7,15 @@ let tmdb = require("./tmdb.js"); // #region Express setup const app = express(); -const port = 3000; +const port = 5000; app.listen(port, () => { console.log(`Listening on port ${port}`) }) app.use(express.json()); app.use(express.urlencoded({ extended: true })); let api = express.Router(); -app.use("/api", api); +// app.use("/api", api); +app.use("/", api); api.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); @@ -26,9 +27,19 @@ api.use(require('express-log-url')); // #endregion // #region frontend + +api.get("/", (req, res) => { + res.redirect("https://asura.feal.no/"); +}); // Serve static files from the React app -app.use('/', express.static(path.join(__dirname, 'clientbuild'))); -app.use('/tournament/', express.static(path.join(__dirname, 'clientbuild'))); +// app.use('/', express.static(path.join(__dirname, 'clientbuild'))); +// app.use('/tournament/', express.static(path.join(__dirname, 'clientbuild', 'index.html'))); +// app.use('/tournament/*', express.static(path.join(__dirname, 'clientbuild', 'index.html'))); +// app.use('/static', express.static(path.join(__dirname, 'clientbuild/static'))); +// app.get('/*', function (req, res) { +// res.sendFile(path.join(__dirname, 'clientbuild', 'index.html')); +// }); +// app.use('/*', express.static(path.join(__dirname, 'clientbuild'))); // #endregion