Sinatra Applications

Sinatra is a micro-framework for creating web applications. This tutorial explains how to set up a Sinatra application on your Ruby Simple Hosting instance.

# Gemfile
source 'https://rubygems.org'

gem 'rack'
gem 'sinatra'
# config.ru
require './app'
run Sinatra::Application
# app.rb
require 'sinatra'

get '/' do
  "Hello from Sinatra"
end
$ bundle install

You can then add these files to your git tree and deploy it on your instance by following these instructions.

上一次變更: 2016/05/31 10:22 (外部編輯)