Skip to content

eebbesen/ineedagyro-js

Repository files navigation

ineedagyro-js

Gyros near you!

https://www.ineedagyro.com

For other foods, add a term parameter e.g., https://ineedagyro.com/?term=cheese%20steak

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:8080/.

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
npm test

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

To generate tests with human-readable test result report run

npm run test_report

and open mochawesome-report/mochawesome.html.

To generate tests with human-readable test coverage result report run

npm run test_coverage_html

and open coverage/index.html.

Helpy things

cURL

Call Yelp endpoint directly 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

About

Gyros near you

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •