热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

环回加载配置文件错误的NODE_ENV-LoopbackloadingconfigfilesforthewrongNODE_ENV

IamveryconfusedbythisunexpectedbehaviorfromLoopback.我对Loopback的这种意外行为感到非常困惑。Ihavethis

I am very confused by this unexpected behavior from Loopback.

我对Loopback的这种意外行为感到非常困惑。

I have this logged from my Loopback server:

我从我的Loopback服务器记录了这个:

SFOC02Q106HG8WM:crucible-poc-discovery t_millal$ NODE_ENV=test node .
 => Loopback is loading filename =>  /Users/t_millal/WebstormProjects/a/crucible-poc-discovery/server/config.local.js
 => Loopback is loading filename =>  /Users/t_millal/WebstormProjects/a/crucible-poc-discovery/server/config.test.js
 => Loopback is loading filename =>  /Users/t_millal/WebstormProjects/a/crucible-poc-discovery/server/datasources.local.js
 => Loopback is loading filename =>  /Users/t_millal/WebstormProjects/a/crucible-poc-discovery/server/get-local-datasources.js
 => Loopback is loading filename =>  /Users/t_millal/WebstormProjects/a/crucible-poc-discovery/server/datasources.test.js

I have specified NODE_ENV=test

我指定了NODE_ENV = test

why does Loopback still load:

为什么Loopback仍然加载:

server/config.local.js and server/datasources.local.js?

server / config.local.js和server / datasources.local.js?

isn't that a bug? Is it simply because l comes before t in the alphabet? Seems wrong...

这不是一个bug吗?是因为我在字母表中出现之前吗?似乎错了......

1 个解决方案

#1


3  

According to documentation LoopBack always load the following configuration files, if they exist:

根据文档,LoopBack总是加载以下配置文件(如果存在):

server/config.json.
server/config.local.json or server/config.local.js. 
server/datasources.json
server/datasources.local.json or server/datasources.local.js
server/model-config.json
server/model-config.local.json or server/model-config.local.js
server/middleware.json
server/middleware.local.json or server/middleware.local.js
server/component-config.json

推荐阅读
author-avatar
syingjin
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有