Archived
Private
Public Access
1
0

Fixed minor issues + added language support

This commit is contained in:
2023-03-25 18:36:19 +01:00
parent 4422d8818a
commit 6dfb5a4b48
23 changed files with 334 additions and 83 deletions

View File

@@ -3,7 +3,7 @@ import 'zone.js/node';
import { APP_BASE_HREF } from '@angular/common';
import { ngExpressEngine } from '@nguniversal/express-engine';
import * as express from 'express';
import { existsSync } from 'fs';
import { existsSync, readdirSync } from 'fs';
import { join } from 'path';
import { AppServerModule } from './src/main.server';
@@ -25,11 +25,16 @@ export function app(): express.Express {
// Example Express Rest API endpoints
// server.get('/api/**', (req, res) => { });
server.get('/backend', (req, res) => {
let backend = process.env['BACKEND']
let backend = process.env['BACKEND'] || "http://localhost:5110/";
if (!backend?.endsWith("/")) backend += "/";
res.json({url: backend});
});
server.get('/lang', (req, res) => {
const files: string[] = readdirSync(distFolder + "/assets/languages");
res.json({files});
})
// Serve static files from /browser
server.get('*.*', express.static(distFolder, {
maxAge: '1y'