Created
December 13, 2020 21:05
-
-
Save mitnick78/05b6d5d71b79e7dbf4a5261972083d64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import Fluent | |
import Vapor | |
func routes(_ app: Application) throws { | |
let userController = UserController() | |
let basicGroup = app.grouped(User.authenticator()) | |
.grouped(User.guardMiddleware()) | |
basicGroup.post("login", use: userController.login) | |
let todoController = TodoController() | |
app.get("todos", use: todoController.index(req:)) | |
app.post("todos", use: todoController.create) | |
app.delete("todos",":todoID", use: todoController.delete) | |
app.post("users", use: userController.create) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment