process.env.ROOT

编程入门 行业动态 更新时间:2024-10-26 03:25:31
process.env.ROOT_URL是如何工作的(how does process.env.ROOT_URL work)

我正在关注此示例 ,他们使用config.rootUrl = process.env.ROOT_URL || 'http://localhost:3000/'; config.rootUrl = process.env.ROOT_URL || 'http://localhost:3000/'; 我认为这意味着它将根据环境获取页面的URL。 当我在heroku上使用我的应用程序去fb。 它报告错误Can't Load URL 。 我看到当我将链接悬停在某处时,它会显示localhost链接,而不是网站名称。 那么process.env.ROOT_URL是如何工作的呢?

或者他们在哪里定义process.env.ROOT_URL

I'm following this sample and they use config.rootUrl = process.env.ROOT_URL || 'http://localhost:3000/'; I thought this would mean it would get the url of the page depending on the environment. When I use my app on heroku to go to fb. it reports an error Can't Load URL . I see when I hover the link somewhere it shows the localhost link and not the website name. So how does process.env.ROOT_URL work ?

or where do they define process.env.ROOT_URL

最满意答案

ROOT_URL只是一个环境变量。 在Heroku上,你可以设置它:

$ heroku config:set ROOT_URL='whateveryouwant'

ROOT_URL is just an environment variable. On Heroku, you can set it like:

$ heroku config:set ROOT_URL='whateveryouwant'

更多推荐

本文发布于:2023-08-03 01:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1382503.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:process   env   ROOT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!