Closed bhavyaagg closed 6 years ago
Should we use single quote(') or double quote(") in the project?
Good job @bhavyaagg on trying to Modularize the API. It was actually a task planned for GSOC as well. Now we could save some time for that.
However i think we must keep the org related routes in one file and post related routes in another file rather than having two more route files for orgs
and posts
On your previous queries:
We are planning on following Airbnb style guide for Stackle. So it's better to always use single quotes and backticks as necessary. It's also encouraged to use ES6 syntax.
@psnmissaka Thank you for reviewing my PR. Sorry I am not well today. Will update my PRs tomorrow morning. I think we can use eslint also. Would add that too.
For the plural case I think we can do /posts/:postid for single post i guess?
@bhavyaagg I agree on both 1 and 2! I'm not sure about 3, but it sounds good.
@padamchopra @iammosespaulr Please review.
@bhavyaagg I did some reading and yes what you suggested seems like the better way to do it. Let's follow a resource naming style like /api/users
for resource collections and /api/users/:userId
for single resource.
Also we have this one
Conflicting files
stackle_api/server.js
I have updated my PR
@padamchopra I have updated the PR
I have updated the PR to incorporate the necessary changes
@psnmissaka @padamchopra @agentmilindu Can this be merged?
@psnmissaka @agentmilindu I have tested the API Endpoints as well.
I have modularized the API routes. But i think there are some parts which can be improved:
1) HTTP verbs should not be present in the URL https://github.com/scorelab/Stackle/blob/master/stackle_api/app/routes.js#L148
HTTP verb "delete" is also used in the URL
2) Singular and Plural both are used for an object in the URL i.e. We have used /posts as well as /post. https://github.com/scorelab/Stackle/blob/master/stackle_api/app/routes.js#L25 https://github.com/scorelab/Stackle/blob/master/stackle_api/app/routes.js#L49
It should be /api/posts and /api/posts/:postid respectively
Same for orgs and org
3) https://github.com/scorelab/Stackle/blob/master/stackle_api/app/routes.js#L160 This can be /api/stack/subscribe
These are just my opinions. I know I might be wrong. But would love to work on Stackle :)