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

dynamically configure App object or use a router #367

Closed
finete opened this issue Jun 7, 2021 · 2 comments
Closed

dynamically configure App object or use a router #367

finete opened this issue Jun 7, 2021 · 2 comments
Labels
question Further information is requested

Comments

@finete
Copy link

finete commented Jun 7, 2021

How can I configure an App inside a function?
In my local dev environment I am loading a yaml file for the token kwarg, however in prod I am getting env variables.

In other frameworks I would user a Router object for the decorators and then attach it to the App.

Is there a similar method ?

@seratch seratch added the question Further information is requested label Jun 7, 2021
@seratch
Copy link
Member

seratch commented Jun 7, 2021

HI @finete, thanks for asking the question!

As a simple solution, my comment at #245 (comment) may be helpful. In the example, I didn't use decorator methods in register_listeners method. But, if you have the listener function as an inner method inside the register_listeners method, you can use decorator too.

Also, we had a discussion about a kind of plugin systems on the App side at #320 . The idea mentioned in the issue may be something you may prefer. However, as I responded in the issue, we haven't decided any plans for something like that yet.

I hope this was helpful to you.

@seratch
Copy link
Member

seratch commented Jun 15, 2021

Hi @finete, let us know if you have something further to ask/discuss. If everything is clear, would you mind closing this issue?

@finete finete closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants