How to auto reload changed files in development
larryzhao opened this issue · 8 comments
Is there a way to reload modified files on the next request like Rack::Reloader
in Goliath in development?
It does that by default in development mode. That said, if you modify included modules, etc, then you'll have to restart the server.
I am following the approach here https://github.com/dblock/grape-on-goliath to set up a project with Grape on top of Goliath. May I ask where's the problem with this approach which prevents the built-in reload functionality? I see that in the source code it's in test
mode, but it still doesn't work after I changed it to development.
Looks that it just can't work when there's Grape on top of it. I've tried with an easier example here: https://gist.github.com/larryzhao/7913394
Every time I change the value of pong
, I could see in the server output that Rack::Reloader
is triggered to reload this file, but the response is still the same.
Something could be tuned to get the reloading to work again?
Thanks a lot.
Sounds like the API class is being cached... I'd look under the hood of Grape implementation to see what it's doing.
I write a simple script can help it
https://gist.github.com/jjyr/7942368
I met the same issue