Skip to content

Commit 6c6ee42

Browse files
committed
feat: Add login and refresh token routes
1 parent 4364d84 commit 6c6ee42

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/api/routes/auth.routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ import registerValidator from "../middlewars/register.validator";
55
const router = Router();
66

77
router.post('/register', registerValidator, createUser);
8+
router.post('/login', () => {});
9+
router.post('/refresh-token', () => {});
810

911
export default router;

src/api/routes/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Router } from 'express';
2+
import authRoutes from './auth.routes';
3+
import tasksRoutes from './tasks.routes';
4+
5+
const router = Router();
6+
7+
router.use('/auth', authRoutes);
8+
router.use('/tasks', tasksRoutes);
9+
10+
export default router;

src/app.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import express, { Request, Response } from 'express';
2-
import tasksRoutes from './api/routes/tasks.routes';
3-
import authRoutes from './api/routes/auth.routes';
2+
import router from './api/routes';
43

54
const app = express();
65

76
app.use(express.json());
8-
app.use('/tasks', tasksRoutes);
9-
app.use('/auth', authRoutes);
7+
app.use('/api', router);
108

119
app.get('/', (req: Request, res: Response) => {
1210
res.send('Hello, TypeScript Express!');

0 commit comments

Comments
 (0)