Skip to content

Boilerplate API server for applications authenticating via Facebook.

Notifications You must be signed in to change notification settings

fredkelly/go-martini-facebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-martini-facebook

Boilerplate API server for applications authenticating via Facebook.

Motivation

To create simple boilerplate code for building a golang/martini API using Facebook for authentication.

Basic flow

  • User connects to your app (e.g. SPA or mobile)
  • You get an access token from Facebook via the standard OAuth flow
  • That token is then passed to subsequent requests to YOUR API (e.g. Authorization: {MY_TOKEN}).
  • The server then stores a corresponding user record (see models/user.go).

Usage

  • Clone the repository
  • Add database/Facebook app configuration using environment vars (see env-example.sh)
  • Install dependencies using godep
  • run the server go run server.go
  • Try it out curl -H 'Authorization: MY_TOKEN' http://localhost:3000

Built with:

There's also a bunch of other cruft for receiving/rendering JSON - feel free to add/remove as required!

TODO:

Make it better; right now everything is bunch up, would be nice to add some modularity - I'm a n00b Gopher so could use all the help I can get!

About

Boilerplate API server for applications authenticating via Facebook.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published