Make server side rendering fully configurable

merge-requests/27/head
knotteye 2020-10-16 21:57:24 -05:00
parent 961b5fe648
commit 95837beaf7
1 changed files with 7 additions and 7 deletions

View File

@ -12,9 +12,6 @@ import * as chatInteg from "./chat";
import { config } from "./config";
import { readdir, readFileSync, writeFileSync } from "fs";
import { JWT, JWK } from "jose";
import { strict } from "assert";
import { parse } from "path";
import { isBuffer } from "util";
const app = express();
const server = http.createServer(app);
@ -55,12 +52,15 @@ async function init(){
});
}
app.disable('x-powered-by');
//site handlers
//await initSite(config['satyr']['registration']);
//api handlers
//server-side site routes
if(config['http']['server_side_render'])
await initSite(config['satyr']['registration']);
//api routes
await initAPI();
//static files if nothing else matches first
//static files if nothing else matches
app.use(express.static(config['http']['directory']));
//client-side site routes
if(!config['http']['server_side_render'])
await initFE();
//404 Handler
app.use(function (req, res, next) {