ruby - How do I run my modular Sinatra app? -
i'm building new version of lovers sinatra. can view lovers source code on github.
i'm able run app in cucumber mode running cucumber
via cli root directory of repository. but...
1) how run app in development mode?
it's little tricky because it's modular app, , i've moved app.rb
file lib/lovers/application.rb
.
2) how run shotgun
automatically restarts app on every http request?
3) when run ruby app.rb
sinatra app, do?
if answer part 3) well, think i'll able figure out answer 1 & 2.
thanks!
1) run bundle exec shotgun
project root. shotgun, opposed other rack servers thin, designed... actually... designed "development" mode... in reloads code if changes.
2) why on every request? shotgun automatically reloads needed.
3) ruby app.rb
runs small app server (as seen here: http://www.sinatrarb.com/) not want. shotgun should trick.
the important thing see here config.ru
in loversapp's root directory. that's shotgun , other rack servers looking for. loads lib/lovers/application.rb
, sets correct rack_env
, , calls run lovers::application
.
Comments
Post a Comment