Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 667 Bytes

api.rest

File metadata and controls

27 lines (21 loc) · 667 Bytes

# Register/create new user POST http://localhost:3000/api/user/create HTTP/1.1 content-type: application/json

{
"username": "testing", "password": "password", "email": "foo@baz.com"

}

###

# Login with account POST http://localhost:3000/api/user/login HTTP/1.1 content-type: application/json

{
"username": "testing", "password": "password"

}

###

# Use JWT to access protected route GET http://localhost:3000/api/protected HTTP/1.1 content-type: application/json authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZTdhZmI1ODdiYTE1YjVlMzAxYzVkZSIsImlhdCI6MTY0MjU3Mzc1NSwiZXhwIjoxNjQyNjMzNzU1fQ.qzKYAG17Cfhv2hfHFJLLoRz02cv18bDef6CqgZHV50k