I made a backend application with express with all routes i can navigate in my home page where i view all posts that users have posted.
What i want to do right now is to add the like button and upon clicking it making an API call let's suppose /like/:postId and updating the post like numbers with the json response.
The same with comments i want to inside the post detail and get all comment upon clicking the view more button so the same calling /postComment/:postId and getting back all comments and with javascript replacing it inside the DOM without refreshing.
The thing that i found problematic was where i put my API's calls... right now i found an open source project: github.com/dan-divy/spruce where he puts the calls inside the route/api folder
I hope that i'm clear :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Ken S Thanks for replying,
I made a backend application with express with all routes i can navigate in my home page where i view all posts that users have posted.
What i want to do right now is to add the like button and upon clicking it making an API call let's suppose /like/:postId and updating the post like numbers with the json response.
The same with comments i want to inside the post detail and get all comment upon clicking the view more button so the same calling /postComment/:postId and getting back all comments and with javascript replacing it inside the DOM without refreshing.
The thing that i found problematic was where i put my API's calls... right now i found an open source project: github.com/dan-divy/spruce where he puts the calls inside the route/api folder
I hope that i'm clear :)