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';
|
2022-04-01 20:17:29 +00:00
|
|
|
|
2022-04-10 22:04:03 +00:00
|
|
|
import app from 'CommonServer/Utils/StartServer';
|
2022-04-01 20:17:29 +00:00
|
|
|
|
2022-02-27 12:24:02 +00:00
|
|
|
import path from 'path';
|
2020-12-21 06:06:39 +00:00
|
|
|
|
2020-01-16 20:30:32 +00:00
|
|
|
// set the view engine to ejs
|
|
|
|
app.set('views', path.join(__dirname, 'views'));
|
|
|
|
app.set('view engine', 'ejs');
|
2019-08-02 12:56:16 +00:00
|
|
|
|
2020-01-16 20:30:32 +00:00
|
|
|
// public static files
|
2022-03-22 11:19:12 +00:00
|
|
|
app.use(ExpressStatic(path.join(__dirname, 'public'), { maxAge: 2592000 }));
|
2020-01-16 20:30:32 +00:00
|
|
|
|
2020-03-22 14:22:56 +00:00
|
|
|
app.use(
|
|
|
|
'/docs',
|
2022-03-22 11:19:12 +00:00
|
|
|
ExpressStatic(path.join(__dirname, 'public'), { maxAge: 2592000 })
|
2020-03-22 14:22:56 +00:00
|
|
|
);
|
2020-03-22 09:27:39 +00:00
|
|
|
|
2020-01-16 20:30:32 +00:00
|
|
|
// index page
|
2022-04-02 11:35:36 +00:00
|
|
|
app.get(['/', '/docs'], (_req: ExpressRequest, res: ExpressResponse) => {
|
2020-01-16 20:30:32 +00:00
|
|
|
res.render('pages/index');
|
2019-08-02 12:56:16 +00:00
|
|
|
});
|
|
|
|
|
2022-02-25 13:22:20 +00:00
|
|
|
export default app;
|