jserver

package module
v0.0.0-...-6060f00 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: MIT Imports: 7 Imported by: 0

README

test Go Report Card GoDoc

jserver

Simple http server that returns data from json file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONRouter

type JSONRouter struct {
	Router *mux.Router
}

JSONRouter is router for JSON files.

func NewJSONRouter

func NewJSONRouter() *JSONRouter

NewJSONRouter returns a new router instance.

func (*JSONRouter) Add

func (r *JSONRouter) Add(path string, file string) error

Add path that returns data from JSON file. Retruns an error.

func (*JSONRouter) ServeHTTP

func (r *JSONRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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