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

Pass turnilo context to routers #997

Open
adrianmroz-allegro opened this issue Dec 14, 2022 · 0 comments
Open

Pass turnilo context to routers #997

adrianmroz-allegro opened this issue Dec 14, 2022 · 0 comments
Labels
enhancement New feature

Comments

@adrianmroz-allegro
Copy link
Contributor

Right now, we're passing explicitly some settings (via SettingsManager) to each router creator (like https://github.com/allegro/turnilo/blob/master/src/server/routes/mkurl/mkurl.ts#L40)

Ideas:

  • Full blown express middleware
    • Pros: industry standard
    • Cons: we have very little route code, could be overkill
  • Attach SettingsManager (or some composed Context object) to Request
    • Pros: Simpler, better expresses immutable nature of settings
    • Cons: Still need to attach something to each request and pass request object in helper methods.
@adrianmroz-allegro adrianmroz-allegro added the enhancement New feature label Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

No branches or pull requests

1 participant