Make sure you have
- Latest version of Docker
Clone the project
git clone https://github.com/Soufianetyk1337/REST-API-with-NodeJS-Express-MongoDB.git my-projectGo to the project directory
cd my-projectfirst create a .env file and populate it:
cp .env_example .env get your own API KEY from https://emailverification.whoisxmlapi.com and paste it in .env file
EMAIL_VERIFICATION=YOUR_API_KEYBuild the image for the API
make build Start the server
make up - Login, logout, and registration
- Email confirmation ("Confirm your email")
- Email Availability
- Password reset ("Forgot password")
- Password confirmation ("Re-enter your password")
- Forgot password
- Rate limiting ("Too many requests")
| Method | URI | Middleware |
|---|---|---|
POST |
/api/v1/users/register |
userIsGuest , checkEmailExistence, |
POST |
/api/v1/users/login |
userIsGuest , checkEmailExistence, |
DELETE |
/api/v1/users/logout |
|
PATCH |
/api/v1/users/password/reset |
userIsGuest, checkEmailExistence, |
POST |
/api/v1/users/password/confirm |
userIsLoggedIn, userIsVerified, |
POST |
/api/v1/users/password/verify |
userIsGuest |
if you faced problems with Nodemailer using gmail account u might find this helpful