feat(api-user): add basic User Entity and basic routing to fetch all users

This commit is contained in:
sct
2020-08-17 03:12:00 +00:00
parent ccfd223f0f
commit d902ef7277
9 changed files with 92 additions and 22 deletions

15
server/routes/user.ts Normal file
View File

@@ -0,0 +1,15 @@
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;