Skip to content

config.js #2103

Closed
Closed

Description

@giowe

Why can't we just use config.js instead of config.json but we can use config.env.js?

I wish to do this in my base config.js:

module.exports = {
  port: process.argv[2] || pkg.config.port || 7770
}

but I have to create 3 of them (config.development.js , config.staging.js , config.production.js )

Activity

  1. giowe commented on Mar 12, 2016

    @giowe
    Author

    yes... as I said:
    I can use both server/config.{env}.json/js
    but just server/config.json.
    It would be useful a server/config.js

  2. self-assigned this
    on Apr 14, 2016
  3. davidcheung commented on Apr 14, 2016

    @davidcheung
    Contributor

    Hi @giowe, thanks for bringing this up,
    with the use of config.local.js should let you manage only 1 file.

    I'm also curious as to why config.js isn't under the default boot list, while config.local.js and config.<env>.js works

    @bajtos, @superkhau any thoughts?

  4. bajtos commented on Apr 18, 2016

    @bajtos
    Member

    Hello, this is a commonly asked question. The reason why don't support .js extension for "master" configuration files (config, datasources, model-config, etc.) is to allow programatic editing of the configuration via loopback-workspace, for example in StrongLoop Arc. Now we have config.json that is easy to edit via JSON.parse and JSON.stringify. If there was config.js, our tooling would not be able to display and modify this configuration.

    @crandmck @davidcheung could we please write this down somewhere in our docs or FAQ?

  5. bajtos commented on Apr 18, 2016

    @bajtos
    Member
  6. crandmck commented on Apr 18, 2016

    @crandmck
    Contributor

    Added an FAQ item which is duplicated in LoopBack doc space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions