[英]Getting Facebook Messenger Page_Access_Token in .env
According to Facebook Guide line, I was told to create a .env file to store the Page_Access_Token The content in .env is: 根据Facebook指南,有人告诉我创建一个.env文件来存储Page_Access_Token。.env中的内容为:
PAGE_ACCESS_TOKEN="XXXXXXXXXXXXXXXXX"
and we have an app.js that included: 我们有一个app.js,其中包括:
const PAGE_ACCESS_TOKEN = process.env.PAGE_ACCESS_TOKEN;
However, when I console.log(process.env.PAGE_ACCESS_TOKEN); 但是,当我console.log(process.env.PAGE_ACCESS_TOKEN); it returns me an undefined
它给我一个不确定的
Can advise how to fix this problem? 能建议如何解决这个问题?
PS I am using windows and ngrok to test PS我正在使用Windows和Ngrok进行测试
.env
without any configurations or tools does nothing, unless your told your app to, this is just a basic file. 没有任何配置或工具的
.env
不会执行任何操作,除非您告知您的应用程序,否则这只是一个基本文件。
However if you really want to use a .env
to store your environment variables, you may need something like this dotenv 但是,如果您真的想使用
.env
来存储环境变量,则可能需要类似dotenv的东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.