Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat Foodish v2 #17

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/deploy.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'
- name: Install dependencies
run: npm ci
- name: Run deployment scripts
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'
- name: Install dependencies
run: npm ci
- name: Run image checks
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Please note we have a code of conduct, please follow it in all your interactions

## Contributing to the Foodish Image Database

- **IMPORTANT** Please ensure the image(s) you are contributing to the Foodish Image Database is/are either your own creation or free to use, for example, image(s) published under the Creative Commons [CCO License](https://creativecommons.org/public-domain/cc0/).

- **Accepted image format** - `.jpg` (_Please convert the images to only .jpg file extension before submitting._)
- **Minimum image dimensions** - `500 x anything` or `anything x 500`

Expand Down
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# 🍲 Foodish 🍛 [![Website](https://img.shields.io/website?down_color=critical&down_message=down&logo=foodish-api&up_color=success&up_message=up&url=https%3A%2F%2Ffoodish-api.herokuapp.com%2F)](https://foodish-api.herokuapp.com/) [![Deploy to Production](https://github.com/surhud004/Foodish/actions/workflows/deploy.prod.yml/badge.svg)](https://github.com/surhud004/Foodish/actions/workflows/deploy.prod.yml) [![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-green.svg?logo=github)](https://github.com/surhud004/Foodish/blob/main/CONTRIBUTING.md)
# 🍲 Foodish 🍛 [![Website](https://img.shields.io/website?down_color=critical&down_message=down&logo=foodish-api&up_color=success&up_message=up&url=https%3A%2F%2Ffoodish-api.com%2F)](https://foodish-api.com/) [![Deploy to Production](https://github.com/surhud004/Foodish/actions/workflows/deploy.prod.yml/badge.svg)](https://github.com/surhud004/Foodish/actions/workflows/deploy.prod.yml) [![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-green.svg?logo=github)](https://github.com/surhud004/Foodish/blob/main/CONTRIBUTING.md)

![Logo](https://github.com/surhud004/Foodish/blob/main/public/logo.ico 'Samosa')

A Node.js/Express.js REST API to GET a random picture of food dishes.

## Demo

Visit https://foodish-api.herokuapp.com/
Visit https://foodish-api.com/

## API Documentation

Base URL for all endpoints https://foodish-api.herokuapp.com/
Base URL for all endpoints https://foodish-api.com/

_The response time will likely be a few seconds long on the first request, because this app is running on a free Heroku dyno. Subsequent requests will behave as normal._
_The response time will likely be a few seconds long on the first request, because this app is running on a free instance. Subsequent requests will behave as normal._

You may support the project [here](#support).

### Endpoints

Expand All @@ -27,7 +29,7 @@ Example Request-
Example Response-

```
{"image":"https://foodish-api.herokuapp.com/images/burger/burger101.jpg"}
{"image":"https://foodish-api.com/images/burger/burger101.jpg"}
```

---
Expand All @@ -45,7 +47,7 @@ Example Request-
Example Response-

```
{"image":"https://foodish-api.herokuapp.com/images/biryani/biryani32.jpg"}
{"image":"https://foodish-api.com/images/biryani/biryani32.jpg"}
```

---
Expand All @@ -54,29 +56,29 @@ Example Response-

- You are designing a restaurant website and you want to add random food pictures as placeholders.
- You are creating a guess the food dish game.
- You are ordering a pizza but you just want a random choice, visit https://foodish-api.herokuapp.com/images/pizza/ because that's fun! Didn't like the pizza? Just hit refresh!
- You are ordering a pizza but you just want a random choice, visit https://foodish-api.com/images/pizza/ because that's fun! Didn't like the pizza? Just hit refresh!
- You just like to see food pictures (visual hunger) because _you eat with your eyes first._

## Authors

- [Surhud Bhagali](https://github.com/surhud004)
- Special thanks to [Rajaraman Ekambaram](https://github.com/Rtech2014) for providing the initial Foodish image database via [Kaggle](https://www.kaggle.com/datasets).
- Special thanks to [RitaE](https://pixabay.com/users/ritae-19628/) for providing some additional Foodish images via [Pixabay](https://pixabay.com/).
- [Surhud](https://github.com/surhud004)

###### Please note that I do not own any of the Foodish dataset images. All Foodish images and their ownership belong to their original creators.
###### Please note that I do not own any of the Foodish dataset images. All Foodish images and their ownership belong to their original creators mentioned [below](#credits).

## Support

Please [create a new issue](https://github.com/surhud004/Foodish/issues/new) for support and issues.
- Foodish is completely free to use, however, it requires some additional costs to keep the domain and service running. Help me keep it running by [donating here](https://www.paypal.com/donate/?business=WLR547JQ4WM92&no_recurring=0&item_name=To+keep+Foodish+running%21&currency_code=CAD)!
- For technical support and questions, please [create a new issue](https://github.com/surhud004/Foodish/issues/new).

## Contributing

Please read the [CONTRIBUTING](https://github.com/surhud004/Foodish/blob/main/CONTRIBUTING.md) for details on adding images to the Foodish Database.

## Contributors
## Credits

- [angelina-tsuboi](https://github.com/angelina-tsuboi)
- [ElijahRus250](https://github.com/ElijahRus250)
Foodish would not be possible without the work of:
- [Rajaraman Ekambaram](https://github.com/Rtech2014) for providing the initial Foodish image database via [Kaggle](https://www.kaggle.com/datasets).
- [RitaE](https://pixabay.com/users/ritae-19628/) for providing some additional Foodish images via [Pixabay](https://pixabay.com/).

## License

Expand Down
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ app.get('/api', (req, res) => {
const randomFood = Math.floor(Math.random() * randomFoodDB.length);
const catchOfTheDay = randomFoodDB[randomFood];
res.status(200).send({
image: `https://foodish-api.herokuapp.com/images/${anyRandomFood}/${catchOfTheDay.image}`
image: `https://foodish-api.com/images/${anyRandomFood}/${catchOfTheDay.image}`
});
} catch (error) {
res.status(500).send({ error });
Expand Down Expand Up @@ -154,7 +154,7 @@ app.get('/api/images/:food', (req, res) => {
const randomFood = Math.floor(Math.random() * foodDB.length);
finalFood = foodDB[randomFood];
}
res.status(200).send({ image: `https://foodish-api.herokuapp.com/images/${food}/${finalFood.image}` });
res.status(200).send({ image: `https://foodish-api.com/images/${food}/${finalFood.image}` });
} else {
res.status(404).send({ error: 'Not found.' });
}
Expand Down
Loading