Appearance
Configuration
StarterStack uses the standard dotenv
approach to configuration. You will find a dotenv
file located at /backend/.env
Available Configurations
ENV VAR | Description | Default |
---|---|---|
HASH_SALT | used for salting crytographic functions | omitted for security reasons |
SALT_ROUNDS | used for crytographic functions | omitted for security reasons |
DB_HOST | the host for your database | { your-project-name }-db |
DB_NAME | the name of your database | |
DB_USER | the username for your database | |
DB_PWD | the password for your database | pass22pass |
DB_PORT | the database port | 3306 |
DB_DIALECT | the database engine | mysql |
STRIPE_KEY | your stripe key | |
STRIPE_WEBHOOK_SECRET | your stripe webhook secret | |
SITE_NAME | the name of your site (i.e. StarterStack) | |
SITE_HOST_NAME | the host name of your site (i.e. https://www.starterstack.com) | |
SITE_HOST_NAME | the host name of your site (i.e. https://www.starterstack.com) | |
SITE_EMAIL | the email from address for outgoing e-mails | |
SMTP_MAIL_HOST | the smtp host of your outgoing e-mail provider | smtp.mailtrap.io |
SMTP_MAIL_PORT | the smtp port of your outgoing e-mail provider | 2525 |
SMTP_MAIL_USER | the username for your smtp provider account | |
SMTP_MAIL_PASS | the password for your smtp provider account | |
USE_PASSPORT | use passport.js for authentication | true |
PASSPORT_STRATEGY | the passport.js authentication strategy | local |
Using Env Vars During Development
You have access to all of these configurations via the standard node processs.env
.
js
const site_name = process.env.SITE_NAME
Production Deployment
It's generally a good idea to exclude your .env
from your source code repo. As such, StarterStack includes the .env
file in the .gitignore
file. When deploying your application to production it's a common practice to set these as environment variables on your server. Of course, you can still choose to use .env
files in production.