oneuptime/Dashboard/Index.ts

23 lines
566 B
TypeScript
Raw Normal View History

2022-05-22 08:49:16 +00:00
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(
2022-05-22 08:51:47 +00:00
'/dashboard/static/js',
2022-05-22 08:49:16 +00:00
ExpressStatic(path.join(__dirname, 'build', 'static', 'js'))
);
2022-05-22 08:51:47 +00:00
app.use('/dashboard', ExpressStatic(path.join(__dirname, 'build')));
2022-05-22 08:49:16 +00:00
app.get('/*', (_req: ExpressRequest, res: ExpressResponse) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
export default app;