-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development VS Production deployments? #3298
Comments
+1 Would be great to have a best practices section on the documentation for production hardening recommendations(if any). |
@Subaku To disable Explorer, comment out the code loading and mounting the Explorer in import {
RestExplorerBindings,
RestExplorerComponent,
} from '@loopback/rest-explorer';
...
this.bind(RestExplorerBindings.CONFIG).to({
path: '/explorer',
});
this.component(RestExplorerComponent); @raymondfeng @bajtos As of today, I am not aware if we are doing anything based on the setting of an environment variable. However, since LoopBack uses Express underneath, if you set |
Production deployment is a topic that we haven't researched in detail yet, see #1054
At the moment, API Explorer is implemented as a standalone component. It is typically enabled by the following line in your Application's constructor: Until we implement a more robust solution, you can disable the explorer for example this way: const env = process.env.NODE_ENV || 'development';
if (env === 'development') {
this.component(RestExplorerComponent);
}
If you have configured the error-response handler to return full error in HTTP responses, as explained in https://loopback.io/doc/en/lb4/Sequence.html#handling-errors, then make sure to disable that behavior in production. app.bind(RestBindings.ERROR_WRITER_OPTIONS).to({debug: env === 'development'}); Note that |
I'm wanting to know the key differences in deploying my lb4 app in a development environment vs a production environment. Was wanting to make sure I didn't miss anything as I could not find any examples detailing things to look out for.
Appreciate the guidance!
The text was updated successfully, but these errors were encountered: