/user-api-golang

Template user CRUD operations with golang, JWT, postgres

Primary LanguageGo

user-api-golang

A CRUD API template for perform operations on users. Written in golang.

Components

Running instructions

  1. Make sure docker is installed and then run docker compose up --build from base of the repo.
  2. Server should be up on localhost:8000/

Scenarios

Signup

curl -X POST http://localhost:8000/signup -v\
   -H 'Content-Type: application/json' \
   -d '{"email":"test@example.com","password":"somepass","firstName":"John","lastname":"Doe"}'

Login

curl -X POST http://localhost:8000/login -v\
   -H 'Content-Type: application/json' \
   -d '{"email":"test@example.com","password":"somepass"}'

Update user information

curl -X PUT http://localhost:8000/users -v\
   -H 'Authorization: BEARER <token>' \
    -H 'Content-Type: application/json' \
    -d '{"firstName":"Johny","lastname":"Doesnt"}'