-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(backend): validate the routes of application
- Loading branch information
João Paulo
committed
Aug 18, 2020
1 parent
c0bc6bd
commit c6a4a05
Showing
10 changed files
with
6,211 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
backend/src/modules/users/infra/http/routes/sessions.routes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
import { Router } from 'express'; | ||
import { celebrate, Segments, Joi } from 'celebrate'; | ||
|
||
import SessionsController from '../controllers/SessionsController'; | ||
|
||
const sessionsRouter = Router(); | ||
const sessionsController = new SessionsController(); | ||
|
||
sessionsRouter.post('/', sessionsController.create); | ||
sessionsRouter.post( | ||
'/', | ||
celebrate({ | ||
[Segments.BODY]: { | ||
email: Joi.string().email().required(), | ||
password: Joi.string().required(), | ||
}, | ||
}), | ||
sessionsController.create, | ||
); | ||
|
||
export default sessionsRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.