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

Retrieving the express object #2538

Closed
zkrami opened this issue Mar 5, 2019 · 5 comments
Closed

Retrieving the express object #2538

zkrami opened this issue Mar 5, 2019 · 5 comments
Assignees

Comments

@zkrami
Copy link

zkrami commented Mar 5, 2019

Description / Steps to reproduce / Feature proposal

I want to get the express application object so I can use a custom express middleware using app.use()
how can I retrieve it inside the application object ?
and how can I set a controller method as the next handler for the middleware ?!

Current Behavior

Expected Behavior

See Reporting Issues for more tips on writing good issues

@raymondfeng
Copy link
Contributor

We don't expose the express object directly at this point. There are a few options:

@zkrami
Copy link
Author

zkrami commented Mar 6, 2019

I think the facade fulfill some of requirements.
but still I need to access the controller from the express middleware , so I can make CRUD manipulation.
what I am trying to achieve is quite simple actually , I want to upload a file that with pause capability using this package node-uploadx.

@raymondfeng
Copy link
Contributor

raymondfeng commented Mar 6, 2019

Have you considered to use an action to wrap the express middleware using Sequence - see https://loopback.io/doc/en/lb4/Sequence.html? Please note that actions can have dependency injection and therefore they can access controllers.

@raymondfeng
Copy link
Contributor

@zkrami I have improved #2434. PTAL.

@bajtos
Copy link
Member

bajtos commented Mar 7, 2019

Closing as a duplicate of #1293 and #2035.

what I am trying to achieve is quite simple actually , I want to upload a file that with pause capability using this package node-uploadx.

I think #2035 will provide the right tool for your use case, once it's implemented. Would you like to contribute the implementation yourself? We can help you along the way, please leave a comment in #2035 if you are interested.

@bajtos bajtos closed this as completed Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants