How to Modify the StrongLoop's LoopBack Explorer CSS

后端 未结 5 2030
栀梦
栀梦 2020-12-10 03:18

We\'re using Strongloop\'s LoopBack for our REST APIs and would like to modify the CSS for the LoopBack Explorer. However, it\'s not clear which CSS files are being used (Lo

5条回答
  •  暖寄归人
    2020-12-10 03:58

    If you didn't lock the loopback-explorer in package.json or if you started your application from the new release of loopback(v2.x), you have to make another change:

    1. If you generated your loopback app with the generator tool, edit server/component-config.json and change it to this:

      { "loopback-component-explorer": null }

    2.Copy the directory node_modules/loopback-explorer/public/ to server/explorer/ as Miroslav said. If you copy the whole directory you can also change the index.html file.

    1. Edit server/server.js file and add this line: app.use('/explorer',explorer.routes(app, { uiDirs: path.resolve(__dirname, 'explorer') })); also you have to add the explorer module at the top of the file: var explorer = require('loopback-component-explorer');

    4.Customize the ui of your explorer, all the necessary files are in server/explorer

提交回复
热议问题