23andMe / api-example-go

An example API app in Go that tests a user's WNT16 and FAM3C genes for unbreakable bones.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api-example-bones

An example API app in Go that checks a user's WNT16 and FAM3C genes for unbreakable bones. Clone the repository, and look at the .env file to see what environment variables must be set.

Your env's REDIRECT_URI must match the one on your developer dashboard at https://api.23andme.com/dashboard/. Locally you'll probably want http://localhost:PORT/receive_code/.

Heroku

I host the app on Heroku.

I change CLIENT_ID and CLIENT_SECRET to match my API credentials, and delete the PORT variable because Heroku sets it automatically.

heroku config:set CLIENT_ID=xxx
heroku config:set CLIENT_SECRET=xxx
heroku config:set COOKIE_SECRET=xxx
heroku config:set SESSION_NAME=api-example-bones
heroku config:set SESSION_ACCESS_TOKEN_KEY=xxx
heroku config:set REDIRECT_URI=http://yourapp.com/receive_code/
heroku config:unset PORT

Local

Just set your environment variables, build the program, and run it:

go build
./api-example-bones

About

An example API app in Go that tests a user's WNT16 and FAM3C genes for unbreakable bones.


Languages

Language:Go 86.3%Language:CSS 13.7%