You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
338 B
16 lines
338 B
4 years ago
|
import { Router } from 'express';
|
||
|
import { getRepository } from 'typeorm';
|
||
|
import { User } from '../entity/User';
|
||
|
|
||
|
const router = Router();
|
||
|
|
||
|
router.get('/', async (req, res) => {
|
||
|
const userRepository = getRepository(User);
|
||
|
|
||
|
const users = await userRepository.find();
|
||
|
|
||
|
return res.status(200).json(users);
|
||
|
});
|
||
|
|
||
|
export default router;
|