Multiple Sinatra apps using rack-mount

前端 未结 4 1786
南方客
南方客 2020-12-13 20:47

I have a question regarding using rack-mount with Sinatra. I\'ve got two classic-style Sinatra apps. Let\'s call one App defined in app.rb and the other API defined in api.r

4条回答
  •  悲哀的现实
    2020-12-13 21:20

    In config.ru you could also take advantage of Sinatra's middleware feature. If you have several Sinatra apps, each with its own routes, and want to run them simultaneously, you can arrange them in the order you want them found, e.g.

    # config.ru
    ...
    use MyAppA
    use MyAppB
    use MyAppC
    run MyAppD
    

提交回复
热议问题