Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server setup with Node.js & MongoDB #10

Open
sujinleeme opened this issue Jun 29, 2018 · 1 comment
Open

Server setup with Node.js & MongoDB #10

sujinleeme opened this issue Jun 29, 2018 · 1 comment

Comments

@sujinleeme
Copy link
Owner

sujinleeme commented Jun 29, 2018

Refs
Build simple Medium.com on Node.js and React.js

@sujinleeme
Copy link
Owner Author

sujinleeme commented Jun 30, 2018

Install dependencies

  • mongoose
  • express
  • cors
  • connect-multiparty
  • body-parser :
  • helmet : Helmet helps you secure your Express apps by setting various HTTP headers
  • compression : Node.js compression middleware.

Models

  • create database schemas
  • use mongoose, a MongDB connection utility

Controller

Routes

Test Test app API endpoints using cURL

NB: MongoDB instance must be running, before you begin the cURL test. To start a MongoDB server, run the command: mongod.

Test: GET A USER

curl --request GET \
  --url http://localhost:5000/api/user/5a92cf3f2dec79115c8fc78a

sujinleeme added a commit that referenced this issue Jun 30, 2018
sujinleeme added a commit that referenced this issue Jun 30, 2018
sujinleeme added a commit that referenced this issue Jun 30, 2018
sujinleeme added a commit that referenced this issue Jul 1, 2018
sujinleeme added a commit that referenced this issue Jul 1, 2018
sujinleeme added a commit that referenced this issue Jul 1, 2018
sujinleeme added a commit that referenced this issue Jul 1, 2018
sujinleeme added a commit that referenced this issue Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant