progress on setup and account view

This commit is contained in:
2023-09-06 15:54:33 +02:00
parent 4afeb7a146
commit b91337f831
6 changed files with 36 additions and 6 deletions

View File

@@ -52,17 +52,19 @@ const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/se
// Vue SSR and gets its support files (e.g. CSS and JS files) from
// the /home/supportFiles/:file route plus its assets from the /otherAssets/:file
// route).
if ( settings.init ) {
if ( settings.setupDone ) {
app.get( '/', ( req, res ) => {
res.sendFile( path.join( __dirname + '/ui/home/active/en/index.html' ) );
} );
}
// TODO: If no init, initialize DB.
// Set up static routes for static file serving (performance wise not
// that good, but way easier to set up)
console.log( '[ Server ] Setting up static routes' );
if ( settings.init ) {
if ( settings.setupDone ) {
app.use( express.static( 'webapp/main/dist' ) );
} else {
app.use( express.static( 'webapp/setup/dist' ) );
@@ -86,7 +88,7 @@ app.use( cookieParser() );
let file = path.join( __dirname + '/webapp/main/dist/index.html' );
console.log( '[ Server ] loading backend components' );
if ( settings.init ) {
if ( settings.setupDone ) {
require( './backend/helperRoutes.js' )( app, settings ); // Helper routes
require( './admin/adminRoutes.js' )( app, settings ); // admin routes
require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes

View File

@@ -28,7 +28,7 @@ module.exports = ( app, settings ) => {
if ( data[ 0 ] ) {
let dat = {};
for ( let element in data[ 0 ] ) {
if ( element === 'pass' ) {
if ( element !== 'pass' ) {
dat[ element ] = data[ 0 ][ element ];
}
}

View File

@@ -1 +1,17 @@
{"init":false,"twoFA":"enforce","setupKey":"hello world","twoFAMode":"enhanced","db":"json","payments":"stripe","name":"libreevent","yourDomain":"http://localhost:8080","mailSender":"libreevent <info@libreevent.janishutz.com>","maxTickets":10,"currency":"CHF","gcInterval":300,"ticketTimeout":900,"startPage":"default","version":"1.0.0"}
{
"init":false,
"setupDone": true,
"twoFA":"enforce",
"twoFAMode":"enhanced",
"db":"json",
"payments":"stripe",
"name":"libreevent",
"yourDomain":"http://localhost:8080",
"mailSender":"libreevent <info@libreevent.janishutz.com>",
"maxTickets":10,
"currency":"CHF",
"gcInterval":300,
"ticketTimeout":900,
"startPage":"default",
"version":"1.0.0"
}