完全不了解web 开发 买了个vps 想自己试试, 想用sinatra 写个web service
require 'sinatra'
get '/'do
"Just Do It"
server = ::Thin::Server.new(options[:Host] || '106.3.38.47',
options[:Port] || 996,
app)
end
我想吧 sinatra 的Demo 跑在我的VPS上,应该如何做啊,106.3.38.47:996无法访问,localhost:4567 可以,求指导
See the official document config.ru
Use config.ru to run traditional applications Write your app:
Add the corresponding config.ru:
When to use config.ru? You may need to use config.ru:
You need to use different Rack processor deployment (Passenger, Unicorn, Heroku, …).
You want to use one or more subclasses of Sinatra::Base.
You only want to use Sinatra as a middleware, not an endpoint.
You don’t need to switch to config.ru just because you switch to modular mode, and you don’t need to switch to modular mode just to run config.ru.
Then, you need to use
thin
或者Passenger
,unicorn
etc. web server to run your program