2022-04-01 20:17:29 +00:00
|
|
|
import {
|
2022-03-21 22:26:54 +00:00
|
|
|
ExpressRequest,
|
|
|
|
ExpressResponse,
|
2022-04-01 20:17:29 +00:00
|
|
|
ExpressStatic,
|
2022-05-31 13:57:15 +00:00
|
|
|
ExpressApplication,
|
2022-04-10 21:57:14 +00:00
|
|
|
} from 'CommonServer/Utils/Express';
|
2020-03-04 22:19:39 +00:00
|
|
|
|
2022-05-24 16:46:21 +00:00
|
|
|
import App from 'CommonServer/Utils/StartServer';
|
|
|
|
|
|
|
|
export const APP_NAME: string = 'licensing';
|
2022-05-31 13:57:15 +00:00
|
|
|
const app: ExpressApplication = App(APP_NAME);
|
2020-03-04 22:19:39 +00:00
|
|
|
|
2022-02-27 12:33:33 +00:00
|
|
|
import path from 'path';
|
|
|
|
|
2020-03-12 23:07:43 +00:00
|
|
|
//View engine setup
|
|
|
|
app.set('views', path.join(__dirname, 'views'));
|
|
|
|
app.set('view engine', 'ejs');
|
|
|
|
|
2022-03-22 11:19:12 +00:00
|
|
|
app.use(ExpressStatic(path.join(__dirname, 'views')));
|
|
|
|
app.use('/', ExpressStatic(path.join(__dirname, 'views', 'img')));
|
2020-03-12 23:07:43 +00:00
|
|
|
|
2020-03-04 22:19:39 +00:00
|
|
|
// Routes(API)
|
2022-05-24 16:46:21 +00:00
|
|
|
app.use(`${APP_NAME}/validate`, require('./src/api/license'));
|
2020-03-04 17:28:54 +00:00
|
|
|
|
2022-04-02 11:35:36 +00:00
|
|
|
app.use('/*', (_req: ExpressRequest, res: ExpressResponse) => {
|
2020-03-12 23:07:43 +00:00
|
|
|
res.status(404).render('notFound.ejs', {});
|
2020-03-04 22:19:39 +00:00
|
|
|
});
|
2020-03-04 17:28:54 +00:00
|
|
|
|
2022-02-25 13:22:20 +00:00
|
|
|
export default app;
|