DEV Community

Discussion on: Node backend and api calls same project

Collapse
 
d0xzen profile image
D0xzen • Edited

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 :)