oneuptime/Dashboard/Index.ts
2022-05-22 09:49:16 +01:00

23 lines
564 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(
'/accounts/static/js',
ExpressStatic(path.join(__dirname, 'build', 'static', 'js'))
);
app.use('/accounts', ExpressStatic(path.join(__dirname, 'build')));
app.get('/*', (_req: ExpressRequest, res: ExpressResponse) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
export default app;