diff --git a/.env.example b/.env.example index fe4ed87b..989d12f8 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,15 @@ +# Port number PORT=3000 + +# URL of the Mongo DB MONGODB_URL=mongodb://127.0.0.1:27017/node-boilerplate + +# JWT +# JWT secret key JWT_SECRET=thisisasamplesecret +# Number of minutes after which an access token expires JWT_ACCESS_EXPIRATION_MINUTES=30 +# Number of days after which a refresh token expires JWT_REFRESH_EXPIRATION_DAYS=30 # SMTP configuration options for the email service diff --git a/README.md b/README.md index 503d72d1..34f221c4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ By running a single command, you will get a production-ready Node.js app install ## Quick Start -To create a Node.js project, simply run: +To create a project, simply run: ```bash npx create-nodejs-express-app @@ -53,6 +53,7 @@ cp .env.example .env - [Features](#features) - [Commands](#commands) +- [Environment Variables](#environment-variables) - [Project Structure](#project-structure) - [API Documentation](#api-documentation) - [Error Handling](#error-handling) @@ -145,6 +146,34 @@ yarn prettier yarn prettier:fix ``` +## Enivornment Variables + +The environment variables can be found and modified in the `.env` file. They come with these default values: + +```bash +# Port number +PORT=3000 + +# URL of the Mongo DB +MONGODB_URL=mongodb://127.0.0.1:27017/node-boilerplate + +# JWT +# JWT secret key +JWT_SECRET=thisisasamplesecret +# Number of minutes after which an access token expires +JWT_ACCESS_EXPIRATION_MINUTES=30 +# Number of days after which a refresh token expires +JWT_REFRESH_EXPIRATION_DAYS=30 + +# SMTP configuration options for the email service +# For testing, you can use a fake SMTP service like Ethereal: https://ethereal.email/create +SMTP_HOST=email-server +SMTP_PORT=587 +SMTP_USERNAME=email-server-username +SMTP_PASSWORD=email-server-password +EMAIL_FROM=support@yourapp.com +``` + ## Project Structure ```