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

research: optional enabled property for routes #6

Open
mwcz opened this issue Apr 25, 2018 · 0 comments
Open

research: optional enabled property for routes #6

mwcz opened this issue Apr 25, 2018 · 0 comments

Comments

@mwcz
Copy link
Contributor

mwcz commented Apr 25, 2018

If dynamic routes are needed, currently users need to modify the routes object after its declaration, as in:

if (process.env.ENABLE_FOO_ROUTES === 'true') {
    defaults.routes['/foo/bar'] = { host: "http://localhost:3000" };
}

It would be cleaner to define it within the routes object literal, like so:

routes: {
    '/foo/bar': {
        host: "http://localhost:3000",
        enabled: process.env.ENABLE_FOO_ROUTES === 'true'
    }
}

Main point of research is whether local routes can be defined this way, since they are string literals instead of object literals. I need to remind myself whether local paths can be defined as object literals too.

@mwcz mwcz changed the title research: optinional enabled property for routes research: optional enabled property for routes Jun 11, 2018
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

1 participant