API Resource Server
This is an example of a basic API server that retrieves resources based on the URL pattern. It relies on a MongoDB instance and standard REST conventions.
Getting Started
Seed your MongoDB with some data. In your mongo client, run the following:
use test
db.notes.insert({"note": "This is a note."});
Start up the application server
- Install Godep with
go get -u github.com/tools/godeps
. - Build the application with
make build
. - Run the application within Docker or standalone.
Run modes
- With Docker
- Run
make start
- Access the server at
http://$DOCKER_IP:9000/
- Run
- Standalone
- Run
./golang-rest-server
will start the server athttp://localhost:9000/
and look for a mongo DB atlocalhost
. - Use command line arguments to override:
./golang-rest-server --help
- Run