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

Standard/recommended way to identify Koa application objects #17

Open
jbemmel opened this issue Nov 1, 2019 · 1 comment
Open

Standard/recommended way to identify Koa application objects #17

jbemmel opened this issue Nov 1, 2019 · 1 comment

Comments

@jbemmel
Copy link

jbemmel commented Nov 1, 2019

Middleware like koa-mount has a need to identify Koa application objects, and behave differently if found ( example ).

What would be the standard/recommended way to achieve this? Perhaps by using an exported Symbol in a sub package?

  • const KOA_APPLICATION = require('koa/identification')
    ....
    if ( obj[KOA_APPLICATION] ) ....
@jonathanong jonathanong transferred this issue from koajs/koa Apr 28, 2020
@jonathanong
Copy link
Member

Middleware like koa-mount has a need to identify Koa application objects

not sure this is ever actually necessary in real life. i would just export an array of middleware instead.

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

2 participants