Skip to content
This repository has been archived by the owner. It is now read-only.
An example RESTful API application built with Martini.
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md log error Nov 27, 2013
api.go
data.go fix xml encoding Nov 27, 2013
encoding.go add Find support Nov 26, 2013
errors.go
server.go

README.md

A RESTful API example with Martini

Install and run

To install this example application, run the usual:

go get github.com/PuerkitoBio/martini-api-example

To run locally, it requires cert.pem and key.pem files (for TLS/https). You can generate the pair of files using this simple command, adapted to your environment for the GOROOT part:

go run /path/to/goroot/src/pkg/crypto/tls/generate_cert.go --host="localhost"

When running the API server (which will be named martini-api-example, in your $GOPATH/bin directory), it will look for the *.pem files in the current directory. You can adapt the code as you see fit, if you want to specify, for example, an absolute path (it is in server.go).

Blog post

This repository is the companion source code for my blog post on 0value.com. It shows how to build a RESTful API using the martini package. Please note that martini is currently a moving target, so please file an issue (or submit a PR) if the code doesn't work anymore with more recent versions of martini.

License

The BDS 3-clause license.

You can’t perform that action at this time.