Skip to content

Commit 95fd61b

Browse files
Adding controllers and routes to Authentication of users
1 parent a35940f commit 95fd61b

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import express from 'express'
33
import morgan from 'morgan'
44
import cors from 'cors'
55

6+
import authRoute from './routes/auth.routes'
7+
68
const app = express()
79

810
//Settings
@@ -15,6 +17,8 @@ app.use(express.json())
1517
app.use(express.urlencoded({extended: false}))
1618

1719
//Routes
20+
app.use('/api/auth', authRoute)
21+
1822
app.get('/', (req,res)=>{
1923
res.send(`The API is at http://127.0.0.1:${app.get('port')}`)
2024
})
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Request,Response } from 'express'
2+
import User,{IUser} from '../../models/User'
3+
4+
export const signUp = (req: Request,res: Response)=>{
5+
6+
}
7+
8+
export const signIn = (req: Request,res: Response)=>{
9+
10+
}

src/routes/auth.routes.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 { signIn, signUp } from '../controllers/auth/auth.controller'
3+
4+
const router = Router()
5+
6+
router.post('/signin', signIn)
7+
router.post('signup', signUp)
8+
9+
10+
export default router

0 commit comments

Comments
 (0)