Skip to content

danmbeyah/GO-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API IN GO

Set Up

  1. $ brew install go
  2. $ git clone "git@github.com: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": "test3@example.com","password": "password3"}
  2. http://localhost:8080/# Actions: [POST] Body: {"email": "test3@example.com","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 ./...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages