如何将模块化Sinatra应用程序部署到Heroku?

如何将模块化Sinatra应用程序部署到Heroku?

问题描述:

出于某种原因,我无法访问公共目录中的任何文件。未找到错误。显然,我并没有在网址中放置 public 部分。

For some reason, I can't access any files in the public dir. Not found error. I'm not putting the public part in the URL, obviously.

查看在GitHub上爱好者源代码库

甜。我解决这个问题。阅读 Sinatra配置后,我将这一行添加到我的应用程序类中:

Sweet. I fixed this. After reading about Sinatra Configurations, I added this line to my application class:

set :root, Lovers.root

有效!