最佳答案
我认为你的问题是你不能像往常一样在 sinatra 中存储全局变量。您需要在这样的设置中存储页面浏览计数数据
设置:my_config_property,'hello world'
这是有关它的文档 http://www.sinatrarb.com/configuration.html 所以关于它的问题In Sinatra(Ruby), how should I create global variables which are assigned values only once in the application lifetime?
关于javascript - 页面浏览量计数器 sinatra?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29708416/