mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
30 lines
741 B
TypeScript
30 lines
741 B
TypeScript
import {
|
|
ExpressRequest,
|
|
ExpressResponse,
|
|
ExpressStatic,
|
|
ExpressApplication,
|
|
} from 'CommonServer/Utils/Express';
|
|
|
|
import App from 'CommonServer/Utils/StartServer';
|
|
|
|
export const APP_NAME: string = 'licensing';
|
|
const app: ExpressApplication = App(APP_NAME);
|
|
|
|
import path from 'path';
|
|
|
|
//View engine setup
|
|
app.set('views', path.join(__dirname, 'views'));
|
|
app.set('view engine', 'ejs');
|
|
|
|
app.use(ExpressStatic(path.join(__dirname, 'views')));
|
|
app.use('/', ExpressStatic(path.join(__dirname, 'views', 'img')));
|
|
|
|
// Routes(API)
|
|
app.use(`${APP_NAME}/validate`, require('./src/api/license'));
|
|
|
|
app.use('/*', (_req: ExpressRequest, res: ExpressResponse) => {
|
|
res.status(404).render('notFound.ejs', {});
|
|
});
|
|
|
|
export default app;
|