Sha256: 5474b0af4d07b3a8f1f96fd15b1987b1f750af5ca5fccf2fcc7d2cd440491235
Contents?: true
Size: 758 Bytes
Versions: 13
Compression:
Stored size: 758 Bytes
Contents
require 'sinatra/base' require 'tilt/erubis' require 'json' require_relative '<%= @gen.wormname %>/racks' require_relative '<%= @gen.wormname %>/helpers' module <%= @gen.camelname %> class App < Sinatra::Base helpers do include <%= @gen.camelname %>::Helpers end get '/' do headers 'Vary' => 'Accept' respond_to do |wants| wants.html do @content = '<h1>Hello from <%= @gen.camelname %></h1>' @title = '<%= @gen.camelname %>' erb :index, layout: :default end wants.json do { app: '<%= @gen.camelname %>' }.to_json end end end # start the server if ruby file executed directly run! if app_file == $0 end end
Version data entries
13 entries across 13 versions & 1 rubygems