How to Modify the StrongLoop's LoopBack Explorer CSS
You can provide your own version of Swagger UI files via options.uiDirs
.
Edit your
server/server.js
and add this config option to the explorer:app.use(explorer(app, { uiDirs: path.resolve(__dirname, 'explorer') }));
Copy the directory
node_modules/loopback-explorer/public/css
toserver/explorer/css
Customize the copied CSS files as you need.
You should lock loopback-explorer's major & minor version in your package.json. Newer versions of loopback-explorer may change the CSS in which case your customization may stop working.
How to customize the api version that appear in loopback 4 generated API explorer?
At this moment, you can modify the spec manually. First get the application's OpenAPI spec by calling app.restServer.getApiSpec()
Then modify the spec accordingly (change the version
inside info
to be the same as the version
in package.json), and setting the new spec by calling app.api(your_new_spec)
LoopBack team is building an OpenAPI spec enhancer service to make ^ automatically happen by applying spec enhancers. See the usage and demo documentation in Extending-OpenAPI-specification
After finishing story Adding an enhancer service in the rest server, you will be able to modify the spec by applying your enhancer.
What is {nk} in loopback API explorer?
I think it's related to Nested queries.
May be {nk} stands for nested foreign key.
How to Read Query Filters from Within a LoopBack Model
Declare filter
query paramerter as argument for your formatted
remote method and then access it just like callback
argument.
See how to describe arguments in docs.
Loopback: How can we modify the return data of a built in model function
You need to remove strong-error-handler
from middlewares and add your custom error handler like this
In config.json
you need to do :
...
"remoting" {
...
"handleErrors": false
...
}
...
Also create config.local.js
in root/sever folder and add below :
'use strict';
var errorConverter = require('./middlewares/error-converter');
module.exports = {
remoting: {
errorHandler: {
handler: errorConverter()
}
}
};
error-converter.js
in middleare folder (or any other place) is the custom error hadnling middleare
Related Topics
Remove New Firefox Autofill Color
Elastic Easing in CSS3, Best Approach
Is There Any IE8 Only CSS Hack
What Does the Selector [Class^="Span"] Do
What Is the Default Style of the Blue Focus Outline in Chrome
Ie: Nth-Child() Using Odd/Even Isn't Working
React Animate Transition Between Components
Difference Between Float and Align Property in CSS
How to Float an Element Left with Full Height of the Wrapper
Font-Size:62.5% VS. Font-Size:10Px
Shared Styles Across Components in an Angular 2 App
Twitter Bootstrap - Same Heights on Fluid Columns
Use HTML Tag Names, Classes or Ids in CSS
How to Combine Cursor: Not-Allowed and Pointer-Events: None;
How to Set Width of a P:Column in a P:Datatable in Primefaces 3.0