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

Endpoints #2

Open
95Rawan opened this issue Aug 13, 2019 · 0 comments
Open

Endpoints #2

95Rawan opened this issue Aug 13, 2019 · 0 comments

Comments

@95Rawan
Copy link
Owner

95Rawan commented Aug 13, 2019

All the endpoints of this app:

1. GET /

  • Get data from database ( getData query to get only the meals name and its img).
  • Send data to the front-end using home.hbs by res.render('foods', {getData result}).

2. GET /meal/:id

Back-end side

  • Getting the id of the selected meal by using req.params.id.
  • Passing the id to the getMealData query to get all data about the selected meal(the data that should return is: foodName, country, img, description, in that order).
  • Send the data to the front-end using meal.hbs by res.render('meal', { getMealData result }).
    Front-end side
  • I should have a meal.hbs file to send the data in.

3. POST /meal

  • Create a form using postMeal.hbs.
  • Take the form's information and send them to the database using postMeal query.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant