Skip to content
/ skeleton Public

Restful API application skeleton, based on Martini framework.

Notifications You must be signed in to change notification settings

3d0c/skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Martini based MVC skeleton

This is an application skeleton for typical API server, based on martini framework. You can quickly bootstrap your environment, using some MVC principles.
This is a renewed version, so if you're looking for full featured example, that was here before, please checkout v1.0 branch.

Usage

Get it:

go get github.com/3d0c/skeleton

Generate ssl keys:

go run $GOROOT/src/pkg/crypto/tls/generate_cert.go --host localhost --ca

it will generate cert.pem and key.pem files.

Check out config.json for base settings. Default one:

{
    "application" : {
        "listen_on" : ":5500",
        "https_on"  : ":5443",
        "ssl_cert"  : "./cert.pem",
        "ssl_key"   : "./key.pem"
    }
}

Run it by simple go run app.go or using some code reloader gin -p 5000 -a 5500, so it will be available on 5500 or 5000 port.

Check it:

~ curl -i http://localhost:5500/posts/1

HTTP/1.1 200 OK
Access-Control-Allow-Headers: Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Origin: *
Cache-Control: max-age=2592000
Cache-Control: public
Content-Type: application/json
Pragma: public
Date: Mon, 18 Aug 2014 21:37:25 GMT
Content-Length: 19

{
  "id": "1",
  "name": "yyy"
}

About

Restful API application skeleton, based on Martini framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages