oneuptime/Dashboard/Index.ts
2022-05-22 09:51:47 +01:00

23 lines
566 B
TypeScript
Executable File

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