Skip to content

eebbesen/ineedagyro-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0279a02 · Dec 30, 2022

History

53 Commits
Sep 17, 2022
Mar 10, 2019
Mar 16, 2018
Mar 10, 2019
Mar 10, 2019
Sep 17, 2022
Jan 24, 2018
Jun 28, 2017
Sep 22, 2017
Sep 22, 2017
Sep 20, 2017
Sep 17, 2022
Jun 28, 2017
Apr 11, 2019
Mar 16, 2018
Mar 16, 2018
Dec 30, 2022
Sep 17, 2022
Feb 19, 2018

Repository files navigation

ineedagyro-js

Gyros near you!

https://www.ineedagyro.com

How?

Uses browser's navigation.geolocation.getCurrentPosition() to query Yelp's Fusion API using yelp-fusion.

Run

  1. Get API ID and secret from Yelp
  2. Set those values in your environment See https://www.yelp.com/developers/v3/manage_app
export YELP_API_KEY=<your_yelp_API_ID>

Using npm directly

npm install
npm start

Using Docker

Build

To ensure you're not using an out-of-date image

docker-compose build

Run

docker-compose up -d

Then browse to http://localhost:8081/

Other options

If you want to view logs, omit -d from the previous command or

docker-compose logs -f

Test

Make sure karma-chrome-launcher is installed. This may cause problems with CI.

npm install karma-chrome-launcher --save-dev --link

Run tests

npm test

will run mocha for the server-side JavaScript and karma for the client-side tests

Helpy things

cURL

Call with token

Export the Yelp token you received (see above) export YELP_API_KEY=<see_get_token_section> then execute the request

curl -H "Authorization: Bearer $YELP_API_KEY" https://api.yelp.com/v3/businesses/search?location=48226&term=gyro

Chrome location permissions reset

https://support.google.com/chrome/answer/114662?co=GENIE.Platform%3DDesktop&hl=en