API containing basic login and signup routes using MongoDB, Express, & Node.
Based off of Advanced React and Redux tutorial on Udemy, specifically Server Setup - Authentication content.
-
Go into project folder
-
If not already existing, create a new file named 'config.js' in config directory based off of the example file and update the details appropriately (Never commit this file).
-
Install mongodb locally if needed
-
If you don't want to use or install a local database, you may opt to use your remote database you provided in config.js.
-
Run the following commands
- Install dependencies
npm install
- If you want to use your locally installed mongo database.
npm run local
- If you want to use a remote dev mongo database.
npm run dev
localhost:3001
Public route
Protected route, authorization token required in header.
Public route, new email and password json required in body of request.
Protected route, valid email and password json required in body of request.