您的位置:首页 > 移动开发

[NodeJS] Use Secrets When Deploying Applications with Now

2016-10-02 22:23 253 查看
Applications require a lot of sensitive information. Database passwords, API keys and secrets used for signing JWTs, just to name a few. If you're deploying your application using the Now CLI, you can deploy your secret information right through the CLI and give your code access to those secrets without exposing them directly in your source code. In this lesson, we'll cover how to add secrets to now, how to use a secret as the value of an environment variable and how to list and remove secrets in now.

// Create a secret
now secrets add super-secret-message "Mr. Bond"

// List Secrets
now secrets ls

// Deploy and Assign Secret to Environment Variable
now -f -e GREETING=@super-secret-message

// Remove Secret
now secrets rm super-secret-message

// Deploy with Standard Environment Variable Value
now -f -e GREETING=Eggheads

// Remove Deployment with Secret
now rm <DEPLOYMENT ID>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐