2022-05-13 10:50:24 +00:00
|
|
|
import app from 'CommonServer/Utils/StartServer';
|
|
|
|
import path from 'path';
|
2022-04-01 20:17:29 +00:00
|
|
|
import {
|
2022-03-21 22:26:54 +00:00
|
|
|
ExpressRequest,
|
|
|
|
ExpressResponse,
|
2022-03-22 11:19:12 +00:00
|
|
|
ExpressStatic,
|
2022-04-10 21:57:14 +00:00
|
|
|
} from 'CommonServer/Utils/Express';
|
2019-09-09 13:30:52 +00:00
|
|
|
|
2022-03-22 11:19:12 +00:00
|
|
|
app.use(ExpressStatic(path.join(__dirname, 'build')));
|
2021-12-30 07:25:15 +00:00
|
|
|
|
2021-12-27 12:06:39 +00:00
|
|
|
app.use(
|
2021-12-30 07:25:15 +00:00
|
|
|
'/accounts/static/js',
|
2022-03-22 11:19:12 +00:00
|
|
|
ExpressStatic(path.join(__dirname, 'build', 'static', 'js'))
|
2021-12-27 12:06:39 +00:00
|
|
|
);
|
2021-12-29 13:16:55 +00:00
|
|
|
|
2022-03-22 11:19:12 +00:00
|
|
|
app.use('/accounts', ExpressStatic(path.join(__dirname, 'build')));
|
2021-12-30 07:25:15 +00:00
|
|
|
|
2022-03-22 11:19:12 +00:00
|
|
|
app.get('/*', (_req: ExpressRequest, res: ExpressResponse) => {
|
2020-02-27 11:15:46 +00:00
|
|
|
res.sendFile(path.join(__dirname, 'build', 'index.html'));
|
2019-08-02 12:56:16 +00:00
|
|
|
});
|
|
|
|
|
2022-05-13 10:50:24 +00:00
|
|
|
export default app;
|