Document dotenv 16 quoting rule for .env values #11

Merged
Paddy merged 1 commits from feature/api-esm-prep into master 2026-09-05 14:13:29 +00:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit bf7f45acce - Show all commits
+2
View File
@@ -1,3 +1,5 @@
# Values containing #, ", \ or surrounding spaces must be single-quoted
# (dotenv 16 treats an unquoted # as a comment): DB_PASSWORD='abc#def'
PORT=3000 PORT=3000
DB_HOST= DB_HOST=
+5
View File
@@ -47,6 +47,11 @@ Express.js REST API in TypeScript with a service-oriented layering. Domains: `Ca
## Environment ## Environment
dotenv 16 parses `.env` stricter than the old dotenv 8: an unquoted `#` starts a comment and
backslash escapes inside double quotes are expanded. Wrap any value containing `#`, `"`, `\` or
surrounding spaces in single quotes (`DB_PASSWORD='abc#def'`), which are taken literally.
A truncated password shows up as MariaDB "Access denied ... (using password: YES)".
Copy `.env.example` (or create `.env`) with: Copy `.env.example` (or create `.env`) with:
``` ```
PORT= PORT=