mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 17:36:23 +00:00
33 lines
617 B
Ruby
33 lines
617 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rack-flash'
|
|
require 'sinatra/base'
|
|
require 'sinatra/reloader' if ENV['RACK_ENV'] == 'development'
|
|
require 'sinatra_warden'
|
|
require_relative 'login'
|
|
require_relative 'site'
|
|
require_relative '../sutty'
|
|
|
|
module Sutty
|
|
# Sutty
|
|
class App < Sinatra::Base
|
|
use Rack::Flash
|
|
use Sutty::Login
|
|
use Sutty::Site
|
|
register Sinatra::Warden
|
|
|
|
configure :development do
|
|
register Sinatra::Reloader
|
|
end
|
|
|
|
set :root, Sutty.root
|
|
|
|
before do
|
|
authorize! '/login' if ENV['RACK_ENV'] == 'production'
|
|
end
|
|
|
|
get '/' do
|
|
haml :index
|
|
end
|
|
end
|
|
end
|