简体   繁体   中英

Loopback loading config files for the wrong NODE_ENV

I am very confused by this unexpected behavior from Loopback.

I have this logged from my Loopback server:

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

why does Loopback still load:

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

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM