oneuptime/Licensing/index.ts
Nawaz Dhandala e8a116f3b0
fix
2022-04-10 23:04:03 +01:00

26 lines
621 B
TypeScript

import {
ExpressRequest,
ExpressResponse,
ExpressStatic,
} from 'CommonServer/Utils/Express';
import app from 'CommonServer/Utils/StartServer';
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('/license/validate', require('./src/api/license'));
app.use('/*', (_req: ExpressRequest, res: ExpressResponse) => {
res.status(404).render('notFound.ejs', {});
});
export default app;