-1

I'd like to disable the strongloop api explorer (pref as noted in docs) - not clear if this is a bug or documentation issue.

Setting or replacing component config or using component-config.production as noted in the docs fails and generates an critical error / crashing express.

// Original
{
  "loopback-component-explorer": {
    "mountPath": "/explorer"
  }
}

// changes made to disable
{
  "loopback-component-explorer": false
}

Docs: https://docs.strongloop.com/display/APIC/Preparing+for+deployment#Preparingfordeployment-DisablingAPIExplorer

Ryann Graham
  • 8,079
  • 2
  • 29
  • 32
FilmFest
  • 1
  • 1

2 Answers2

1

Remove the loopback-component-explorer entry from your component-config.json file entirely.

Matt Hamann
  • 1,488
  • 12
  • 24
  • Removing it entirely , causes a crash error. Again I'm trying to follow the docs and use an environment var (node env 'production') to disable it only on production. The docs suggest this is possible, but don't work as advertised. – FilmFest Apr 04 '16 at 19:01
  • Can you confirm what version of `loopback` and `loopback-component-explorer` you are using? – Matt Hamann Apr 11 '16 at 03:28
0

You can remove only 'loopback-component-explorer' part from 'component-config.json' and keep the empty object, where the code will not get crashed.

Original code:

{
 "loopback-component-explorer": {
 "mountPath": "/explorer"
 }
}

Updated:

{
}

Also can turn off stack traces, more info here

Captain Sparrow
  • 1,114
  • 17
  • 26