Revert hosting

This commit is contained in:
Felix Albrigtsen 2022-03-29 10:45:50 +02:00
parent 5c494d7018
commit f3f5dbd864
1 changed files with 9 additions and 8 deletions

View File

@ -15,7 +15,7 @@ app.use(express.json());
app.use(express.urlencoded({ extended: true })); app.use(express.urlencoded({ extended: true }));
let api = express.Router(); let api = express.Router();
// app.use("/api", api); // app.use("/api", api);
app.use("/", api); app.use("/api", api);
api.use(function(req, res, next) { api.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Origin", "*");
@ -28,17 +28,18 @@ api.use(require('express-log-url'));
// #region frontend // #region frontend
api.get("/", (req, res) => { // api.get("/", (req, res) => {
res.redirect("https://asura.feal.no/"); // res.redirect("https://asura.feal.no/");
}); // });
// Serve static files from the React app // Serve static files from the React app
// app.use('/', 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('/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.use('/static', express.static(path.join(__dirname, 'clientbuild/static')));
// app.get('/*', function (req, res) { app.use('/static/*', express.static(path.join(__dirname, 'clientbuild/static')));
// res.sendFile(path.join(__dirname, 'clientbuild', 'index.html')); app.get('/*', function (req, res) {
// }); res.sendFile(path.join(__dirname, 'clientbuild', 'index.html'));
});
// app.use('/*', express.static(path.join(__dirname, 'clientbuild'))); // app.use('/*', express.static(path.join(__dirname, 'clientbuild')));
// #endregion // #endregion