20 lines
495 B
TypeScript
20 lines
495 B
TypeScript
import * as express from 'express';
|
|
import userRouter from './api/user';
|
|
import healthRouter from './healthcheck';
|
|
|
|
const router = express.Router();
|
|
export default router;
|
|
|
|
router.use('/api/user', userRouter);
|
|
router.use('/health', healthRouter);
|
|
|
|
/* GET home page. */
|
|
router.get('/', async (req, res) => {
|
|
const email = (await req.getUserInfo())?.email ?? 'No email found!';
|
|
res.render('index', {title: 'Express', email});
|
|
});
|
|
|
|
router.get('/logout', (req, res) => {
|
|
res.initLogout();
|
|
});
|