简体   繁体   English

如何为项目创建 a.env 文件以隐藏 API 密钥

[英]How do I create a .env file for a project to hide API key

Trying to create a.env file to hide an API key in my React project.试图创建一个 .env 文件来隐藏我的 React 项目中的 API 键。 Using the terminal in the root of my project I tried touch.env - no response, then I tried mv.env and now I'm getting:使用项目根目录中的终端,我尝试了 touch.env - 没有响应,然后我尝试了 mv.env,现在我得到了:

usage: mv [-f |用法:mv [-f | -i | -i | -n] [-v] source target mv [-f | -n] [-v] 源目标 mv [-f | -i | -i | -n] [-v] source... directory -n] [-v] 源...目录

Maybe it already created, but hidden in you directory.也许它已经创建,但隐藏在你的目录中。 Try to see it using尝试使用

ls -a

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当必须用撇号包装时,如何隐藏 API 密钥? - How do i hide API key when it must be wrapped in apostrophe? 如何在 Wordpress PHP 文件中隐藏外部 API 密钥? - How can I hide an external API key in a Wordpress PHP file? 如何在客户端Javascript中调用Node / Express API密钥(.env)? - How do I call a Node/Express API key (.env) in Client-side Javascript? 使用谷歌地图js API时是否需要隐藏API键? 如果是这样,怎么做? - Do I need to hide API key when using google maps js API? If so, how? .env文件中的API密钥401错误 - Error with API Key 401 error in .env file 没有.env文件时,如何使用dotEnv? - How do I use dotEnv when there is no .env file? 在React中的.env文件中隐藏API密钥是否是最佳实践 - Is it best practice to hide API keys in .env file in React 如何在 js 文件中隐藏 API 密钥,我使用“axios”从 js 文件请求 url,我的应用程序不是基于节点的 - How to hide API key in a js file, i am using " axios" for requesting a url from js file and my application is not node based 如何隐藏存储在 JavaScript 中的 API 密钥? - How can I hide my API key stored within JavaScript? 如何在getInitialProps中隐藏api键 - How to hide api key in getInitialProps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM