mock-api-server-go

command module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

README

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": "john@example.com",
	"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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL