You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
410 B
TypeScript
19 lines
410 B
TypeScript
2 years ago
|
import {Router, Request, Response} from 'express';
|
||
|
|
||
|
import {User} from '../models/User';
|
||
|
import {AuthRouter} from './auth.router';
|
||
|
|
||
|
const router: Router = Router();
|
||
|
|
||
|
router.use('/auth', AuthRouter);
|
||
|
|
||
|
router.get('/');
|
||
|
|
||
|
router.get('/:id', async (req: Request, res: Response) => {
|
||
|
const {id} = req.params;
|
||
|
const item = await User.findByPk(id);
|
||
|
res.send(item);
|
||
|
});
|
||
|
|
||
|
export const UserRouter: Router = router;
|