Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 799 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 799 Bytes

REST API IN GO

Set Up

  1. $ brew install go
  2. $ git clone "[email protected]:danmbeyah/GO-REST-API.git"

How to run

$ go run main.go

API is accessible at http://localhost:8080

Endpoints

  1. http://localhost:8080/users Actions: [POST/GET/PUT/DELETE] Body: {"username": "test3","email": "[email protected]","password": "password3"}
  2. http://localhost:8080/login Actions: [POST] Body: {"email": "[email protected]","password": "password3"}

Example

Create user on Insomnia

Tests

  1. To run individual test

go test --run TestGetUserByID or go test -v --run TestGetUserByID

  1. To run tests in a specific folder, CD into that test folder eg modeltests and:

go test -v

  1. To run all tests, CD into tests folder and run:

go test -v ./...