-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
.env file is not respected in certain environment config files
Steps to reproduce the behavior
- Create
.envfile in the root of strapi app - Put any variable, i.e.
DATABASE_PORT=27017 - Run development server using
yarn develop MongoError: database name must be a string
Expected behavior
Environment variables defined in .env file are respected when building the project
Screenshots
If applicable, add screenshots to help explain your problem.
Code snippets
config/environments/development/database.json
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "strapi-hook-mongoose",
"settings": {
"client": "mongo",
"host": "${process.env.DATABASE_HOST || '127.0.0.1'}",
"port": "${process.env.DATABASE_PORT || 27017}",
"database": "${process.env.DATABASE_NAME || ''}",
"username": "${process.env.DATABASE_USERNAME || ''}",
"password": "${process.env.DATABASE_PASSWORD || ''}"
},
"options": {}
}
}
}
System
- Node.js version: 10.7.0
- NPM version: 6.9.0
- Strapi version: 3.0.0-beta.8
- Database: Mongo
- Operating system: MacOSX 10.14.5
ceefour
Metadata
Metadata
Assignees
Labels
No labels