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

Allow app and package to depend on reststop2 #19

Closed
hellogerard opened this issue Apr 3, 2014 · 2 comments
Closed

Allow app and package to depend on reststop2 #19

hellogerard opened this issue Apr 3, 2014 · 2 comments

Comments

@hellogerard
Copy link
Contributor

If an app depends on reststop2 and a package in the app depends on reststop2, you get an error: Error: RESTstop.configure() has to be called before first call to RESTstop.add().

@hellogerard
Copy link
Contributor Author

The package and app are both calling configure.

Maybe we can tweak reststop to not automatically start until an explicit call to start by the application code - this way packages can add routes.

A more robust (difficult) solution could do away with the started flag and just be able to adapt to configuring and adding routes on the fly.

I think having an explicit 'start' call would work best. Browsing the code, I think this would work, though I'd have to try it out of course – bad thing is, it would break backwards compat. since older installs would now need to call 'start'.

As I type that, I'd really like to allow reststop to be used in other packages. So let me focus on option #1 – worst case is we require an explicit 'start' call, but maybe there's a way to fix it w/o any external changes.

@hellogerard
Copy link
Contributor Author

@schnie @calebl

Hey guys, re: this issue with having reststop in a package and in the app. I've modified things so that you can call configure at any time in the app. So it doesn't have to be before the 1st call to add. configure can only be called once. (I thought about allowing multiple calls to configure so an app could override, but it created a lot of complexity around keeping other config options consistent.)

I tested this locally, and it's working. Can you guys try it in your app? @schnie, you'll have to use the latest reststop2 master, but it shouldn't be an issue since the only new things since 0.5.5 are bug fixes.

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