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