![]() ![]() Use this phase also for sub-apps like loopback/server/middleware/rest or loopback-explorer.įiles - Serve static assets (requests are hitting the file system here). Middleware registered via the Express API app.use, app.route, app.get (and other HTTP verbs) runs at the beginning of this phase. Routes - HTTP routes implementing your application logic. auth - Handle authentication and authorization.initial - The first point at which middleware can run.If you register middleware (or routes) with the Express API, then it is executed at the beginning of the routes phase. ![]() See Registering middleware in middleware.json and Using the LoopBack API. When you register middleware, you can specify the phase in which the application will call it. LoopBack defines a number of phases, corresponding to different aspects of application execution. See Registering middleware in JavaScript. Alternatively, register the middleware in application code.See Registering middleware in middleware.json. This is the recommended way to register middleware. See Defining a new middleware handler function. If you are creating a new middleware function, write it.If using an existing function or package, add the code to your application or install the package.See example of error-handling middleware. Error-handling middleware to deal with request errors.Static middleware to serve static client-side assets.Dynamic request handling middleware to serve dynamically-generated responses, for example HTML pages rendered from templates and JSON responses to REST API requests.See example of pre-processing middleware. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |