Skip to content
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

Interceptors #133

Closed
4 tasks
deepakrkris opened this issue Apr 13, 2017 · 4 comments
Closed
4 tasks

Interceptors #133

deepakrkris opened this issue Apr 13, 2017 · 4 comments
Labels
feature REST Issues related to @loopback/rest package and REST transport in general

Comments

@deepakrkris
Copy link
Contributor

deepakrkris commented Apr 13, 2017

  • Must be able to inject request/response interceptors for a Controller
     @intercept('request',  function(request, next) {
        logMessage(request, next);
     });
     @intercept('response', './scripts/error-handler');
     @intercept('request', './scripts/user-context');
     @api(def) 
     class OrderCancellationController {
     .....
     }
  • interceptors will be invoked in the order of declaration for the controller
  • interceptor scripts must export a function with a specific signature
  • An interceptor can modify the request/response, headers and body
@dhmlau
Copy link
Member

dhmlau commented Sep 6, 2017

need a way to register the decorators for interceptors

@bajtos bajtos added the non-MVP label Nov 2, 2017
@bajtos
Copy link
Member

bajtos commented Nov 2, 2017

I think this is conceptually similar to remoting hooks (beforeRemote, afterRemote, afterRemoteError) in LoopBack 3.x

@bajtos bajtos added REST Issues related to @loopback/rest package and REST transport in general post-GA and removed epic.routing labels Jun 21, 2018
@dhmlau dhmlau removed the non-DP3 label Aug 23, 2018
@dhmlau dhmlau removed the post-GA label Nov 2, 2018
@raymondfeng
Copy link
Contributor

@dhmlau
Copy link
Member

dhmlau commented Jun 26, 2019

Closing as done.
See https://loopback.io/doc/en/lb4/Interceptors.html

@dhmlau dhmlau closed this as completed Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature REST Issues related to @loopback/rest package and REST transport in general
Projects
None yet
Development

No branches or pull requests

6 participants