go-json-server

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 3 Imported by: 0

README

go-json-server

A simple json API server that serve json in a specific endpoint.

each endpoint is needed to be configured using config.json

Usages

config.json

{
  "endpoints": [
    { "route": "ping", "jsonpath": "jsons/ping.json" },
    { "route": "hello", "jsonpath": "jsons/hello.json" }
  ]
}

In this config, there are two endpoints. route is the endpoint and jsonpath is the json file to be served. All json files should be in jsons directory.

Use config.json to map the API.

After configuration done, run the application by,

go build .
./go-json-server

Development

cd go-json-server
go mod download
go run main.go

Author

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