Social Api is an example of a working version of api for a social network on Node Express
- Express
- MongoDB
- Mongoose
- Babel 7
- Mocha
npm install
npm -g eslintMONGO_TEST_URI=mongodb+srv://<user>:<password>@<host>/<collection>
MONGO_URI=mongodb+srv://<user>:<password>@<host>/<collection>
SESSION_SECRET=secret
NODE_ENV=testnpm run startnpm run test
npm run test:watchnpm run lint
npm run lint:fix- POST:
/auth/loginlogin with
{"email": "string", "password": "string"}- GET:
/auth/logoutlogout - POST:
/auth/signupSignUp with
{"email": "string", "password": "string", "name": "string", "lastName": "string"}- GET:
/users/meget current user - GET:
/users/:userIdget user by Id - GET:
/users/find all users
- POST:
/posts/create new post form user
{"title": "string", "body": "string"}- GET:
/posts/:postIdget posts by Id - GET:
/posts/user/:userIdget posts by userId - GET:
/posts/find all posts - POST:
/posts/:postId/upupVote post by postId - POST:
/posts/:postId/downdownVote post by postId
- POST:
/api/auth/loginlogin with
{"email": "string", "password": "string"}- GET:
/api/auth/logoutlogout - GET:
/api/auth/logoutalllogout on all devices - POST:
/api/auth/signupSignUp with
{"email": "string", "password": "string", "name": "string", "lastName": "string"}With Bearer Authorization
- GET:
/api/users/meget current user - GET:
/api/users/:userIdget user by Id - GET:
/api/users/find all users
- POST:
/api/posts/create new post form user
{"title": "string", "body": "string"}- GET:
/api/posts/:postIdget posts by Id - GET:
/api/posts/user/:userIdget posts by userId - GET:
/api/posts/find all posts - POST:
/api/posts/:postId/upupVote post by postId - POST:
/api/posts/:postId/downdownVote post by postId
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.