bump to V1.1.3

This commit is contained in:
2024-08-27 15:48:58 +02:00
parent c074d6c025
commit 7ebd61f612
27 changed files with 92 additions and 47 deletions

View File

@@ -16,7 +16,8 @@ const http = require( 'http' );
const fs = require( 'fs' );
const token = require( './backend/token.js' );
module.exports.run = () => {
module.exports.run = ( rootDir ) => {
global.__starterDir = rootDir ?? __dirname;
console.log( `
_ _ _ _
@@ -46,7 +47,7 @@ module.exports.run = () => {
` );
console.log( '[ Server ] loading settings' );
const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/settings.config.json' ) ) );
const settings = JSON.parse( fs.readFileSync( path.join( __starterDir + '/config/settings.config.json' ) ) );
// Route for static html file for start page (page is compiled using
@@ -64,9 +65,10 @@ module.exports.run = () => {
// that good, but way easier to set up)
console.log( '[ Server ] Setting up static routes' );
if ( settings.setupDone ) {
app.use( express.static( 'webapp/main/dist' ) );
app.use( express.static( __dirname + '/webapp/main/dist' ) );
} else {
app.use( express.static( 'webapp/setup/dist' ) );
console.log( '[ Server ] Booting into setup' );
app.use( express.static( __dirname + '/webapp/setup/dist' ) );
}
// initialise express with middlewares