我正在关注此示例 ,他们使用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'更多推荐
发布评论