This is a simple REST endpoint to event mapper, written in golang
To install just use the go command:
go get github.com/webvariants/susi-gowebstack
This will install the REST server with its dependencies to your $GOROOT
The susi-restapi binary need some commandline options
Usage of ./susi-restapi:
-cert="cert.pem": certificate to use
-https=false: whether to use https or not
-key="key.pem": key to use
-mapping="endpoints.json": the endpoint-event mapping file
-susiaddr="localhost:4000": susiaddr to use
-webaddr=":8080": webaddr to use
susiaddr, key and cert are manadatory to communicate to your local susi-core instance (See the Susi-Readme to get an susi-core instance running)
You can specify your REST endpoints like this:
{
"/api/v1/flower/{id}": {
"GET": "flower::get",
"POST": "flower::add",
"DELETE": "flower::remove",
"PATCH": "flower::update"
}
}
Parameters in the path are passed as payload to the related event. POST, PUT and PATCH also copy their (json) body to the payload.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT License -> feel free to use it for any purpose!
See LICENSE file