Sinatra rack middleware hijacks '/' root url

天涯浪子 提交于 2019-12-04 22:23:36

You don't actually need to include the Sinatra app as middleware to do what you want.

Including it as middleware will mean that all requests are routed through it, which you don't want/need in order to make it supply the routes.

If you want to add the routes automatically when you include the gem in a rails app you could add a railtie that adds routes to the application. I can't remember off the top of my head what that looks like, but it should be pretty straightforward.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!