Skip to content

abhijitWakchaure/mock-api-server-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license Docker Cloud Build Status GitHub release (latest SemVer)

mock-api-server-go

Simple mock API server in go

Schema for user struct

{
	"id": "60624180893d170927d32e27",
	"username": "[email protected]",
	"password": "EQWMJYq40spmT#g",
	"fullname": "John Doe",
	"mobile": "+91 9999999999",
	"createdAt": 1538919475135,
	"modifiedAt": 1599340945571,
	"blocked": false,
	"roles": [
		"ROLE_USER"
	]
}

Exposed APIs (Default)

Method Path
GET /api/users
POST /api/users
GET /api/users/{id}
PUT /api/users/{id}
DELETE /api/users/{id}

Flags

Flag Default Value(s) Description
-endpoint /api/users/ Endpoint for API server
-port 8080 Port for the API server
-version NA Print the server version
-help NA Print the help message

Download the API server

Docker

docker pull abhijitwakchaure/mock-api-server-go

Linux, Windows or Mac

Download the latest binary from here

How to Run the server

Docker

docker run -it -p 8080:8080 abhijitwakchaure/mock-api-server-go

Linux or Mac

Run the server with default port 8080

./mock-api-server-go-v1.0.0-linux-amd64

Specify the port (e.g. 9000)

./mock-api-server-go-v1.0.0-linux-amd64 -p 9000

Windows

Simply run the exe file