oneuptime/Dashboard/Index.ts
Simon Larsen 354def3883
fix lint.
2022-05-31 14:57:15 +01:00

27 lines
687 B
TypeScript
Executable File

import App from 'CommonServer/Utils/StartServer';
import path from 'path';
import {
ExpressRequest,
ExpressResponse,
ExpressStatic,
ExpressApplication,
} from 'CommonServer/Utils/Express';
export const APP_NAME: string = 'dashboard';
const app: ExpressApplication = App(APP_NAME);
app.use(ExpressStatic(path.join(__dirname, 'build')));
app.use(
`/${APP_NAME}/static/js`,
ExpressStatic(path.join(__dirname, 'build', 'static', 'js'))
);
app.use(`/${APP_NAME}`, ExpressStatic(path.join(__dirname, 'build')));
app.get('/*', (_req: ExpressRequest, res: ExpressResponse) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
export default app;