- Notifications
You must be signed in to change notification settings - Fork0
jottenlips/VaporAuthTemplateRequestExamples
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
brew install vapor/tap/vapor
https://docs.vapor.codes/3.0/auth/getting-started/
vapor new hello --auth
cd hello
then
vapor build
vapor run
or
vapor xcode
curl -X "POST" "http://localhost:8080/users" \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "name": "", "email": "", "password": "", "verifyPassword = ""}'
curl -X "POST" "http://localhost:8080/login" \ -H 'Content-Type: application/json; charset=utf-8' \ -u 'myemail:mypassord' \ -d $'{}'
returnstoken
to be used for protected routes.
curl "http://localhost:8080/todos?" \ -H 'Authorization: Bearer mytokenhere' \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{}'
curl -X "POST" "http://localhost:8080/todos" \ -H 'Authorization: Bearer 0BMDp6YeOuH0qYYrXInDhA==' \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "title": "Do the dishes"}'
curl -X "DELETE" "http://localhost:8080/todos/1" \ -H 'Authorization: Bearer 0BMDp6YeOuH0qYYrXInDhA==' \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{}'
## i-registercurl -X "POST" "http://localhost:8080/users" \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "name": "", "email": "", "password": ""}'
curl -X "POST" "http://localhost:8080/login" \ -H 'Content-Type: application/json; charset=utf-8' \ -u 'myemail:mypassord' \ -d $'{}'
returnstoken
to be used for protected routes.
curl "http://localhost:8080/me?" \ -H 'Authorization: Bearer mytokenhere' \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{}'
About
💧 Sample requests and documentation for creating your first authenticated Vapor API 💧
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published