简体   繁体   中英

Using .env Variables with Ghost CMS

I'm trying to use an .env variable for my Ghost application, but I'm running into an issue where my .env file isn't being recognized by my config.js file. I tried setting up my .env file like so:

.env :

NODE_ENV=development
NODE_ENV=production
AWS_ACCESS_KEY=accesskey
AWS_SECRET_KEY=secretkey

and then setting it like so in config.js :

active: 'ghost-s3',
        'ghost-s3': {
         accessKeyId: AWS_ACCESS_KEY,
         secretAccessKey: AWS_SECRET_KEY,
         bucket: 'blog',
         region: 'us-east-1',
         assetHost: '//s3.amazonaws.com/blog/'
        }

but that didn't work. Is there a way to do this using FS.readSync or maybe the foreman module?

尝试:

accessKeyId: process.env.AWS_ACCESS_KEY,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM