1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

fix: desktop mode web index.html js script included

This commit is contained in:
Saad Jutt
2022-03-16 19:20:38 +05:00
parent 99fb5f4b2b
commit 75291f9397

View File

@@ -31,7 +31,6 @@ app.use(cookieParser())
app.use(morgan('tiny'))
app.use(express.json({ limit: '50mb' }))
app.use(express.static(path.join(__dirname, '../public')))
app.use(express.static(getWebBuildFolderPath()))
const onError: ErrorRequestHandler = (err, req, res, next) => {
console.error(err.stack)
@@ -44,6 +43,10 @@ export default setProcessVariables().then(async () => {
const { setupRoutes } = await import('./routes/setupRoutes')
setupRoutes(app)
// should be served after setting up web route
// index.html needs to be injected with some js script.
app.use(express.static(getWebBuildFolderPath()))
console.log('sasJSCoreMacros', sasJSCoreMacros)
app.use(onError)