5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 22:06:22 +00:00
panel/lib/sutty/app.rb

34 lines
617 B
Ruby
Raw Permalink Normal View History

2017-09-28 20:20:31 +00:00
# frozen_string_literal: true
require 'rack-flash'
require 'sinatra/base'
2017-10-05 19:42:32 +00:00
require 'sinatra/reloader' if ENV['RACK_ENV'] == 'development'
2017-09-28 20:20:31 +00:00
require 'sinatra_warden'
require_relative 'login'
2017-10-05 19:42:32 +00:00
require_relative 'site'
2017-09-28 20:20:31 +00:00
require_relative '../sutty'
module Sutty
# Sutty
class App < Sinatra::Base
use Rack::Flash
use Sutty::Login
2017-10-05 19:42:32 +00:00
use Sutty::Site
2017-09-28 20:20:31 +00:00
register Sinatra::Warden
2017-10-05 19:42:32 +00:00
configure :development do
register Sinatra::Reloader
end
2017-09-28 20:20:31 +00:00
set :root, Sutty.root
before do
2017-10-05 19:42:32 +00:00
authorize! '/login' if ENV['RACK_ENV'] == 'production'
2017-09-28 20:20:31 +00:00
end
get '/' do
haml :index
end
end
end