API Help

Associate
Joined
19 Jul 2006
Posts
1,847
Just doing a fun project over the holidays ( playing with node.js and Alexa) never used either of them before and making my own API again never done this only ever consumed them

So I have followed a tutorial https://medium.freecodecamp.org/building-a-simple-node-js-api-in-under-30-minutes-a07ea9e390d2 and have got that up and running for a excersise plan.
So I can get all or get one by the id which is what my understanding of REST is.

However for my Alexa skill I want to be able to get the next excersise depending on the date.

so i would like a function called getNextExcercise() that looks at the date today and gets the next excersice depeding on the date.
And a function called getExcerciseOnDate(Date) which takes a data and returns that excersice for the day.

Am i right in thinking that i can just create a routes that is /exercise/next and exercise/date and run the functions that way or is there a better way of doing this now i have an API.
 
Back
Top Bottom