0

This JSON within a file cannot be parsed:

{
  "facebook": {
    appId: "myAppId",
    appSecret: "myAppSecret"
  }
}

When I use this:

{
  "facebook:appId": "myAppId",
  "facebook:appSecret": "myAppSecret"
}

...the following both return null...

var objFb = nconf.get("facebook");

var appId = nconf.get("facebook:appId");

How do I add a namespace within some JSON within a file?

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189

1 Answers1

3

Just create valid JSON?

{
  "facebook": {
    "appId": "myAppId",
    "appSecret": "myAppSecret"
  }
}

Keys must be strings.

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143