Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/23andme/api-example-go
An example API app in Go that tests a user's WNT16 and FAM3C genes for unbreakable bones.
https://github.com/23andme/api-example-go
Last synced: 3 months ago
JSON representation
An example API app in Go that tests a user's WNT16 and FAM3C genes for unbreakable bones.
- Host: GitHub
- URL: https://github.com/23andme/api-example-go
- Owner: 23andMe
- Created: 2012-10-17T05:04:45.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-01-27T21:36:04.000Z (about 5 years ago)
- Last Synced: 2024-04-14T15:56:01.483Z (10 months ago)
- Language: Go
- Homepage:
- Size: 249 KB
- Stars: 5
- Watchers: 69
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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.
- Setup Go on Heroku: http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html.
- Set environment variables on Heroku: https://devcenter.heroku.com/articles/config-vars.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
go build
./api-example-bones
```