Concepts of modular tonton web application that share authentication
This commit is contained in:
parent
7fe8986bdb
commit
eb759a8454
7 changed files with 192 additions and 75 deletions
|
|
@ -1,18 +1,5 @@
|
|||
require 'gollum/app'
|
||||
require 'sinatra/flash'
|
||||
require "sqlite3"
|
||||
require 'tonton_web'
|
||||
require_relative '../lib/tonton_web'
|
||||
|
||||
class TonTonWeb::App < Sinatra::Base
|
||||
set :host_authorization, { permitted_hosts: ['localhost', 'mytonton.com.br'] }
|
||||
|
||||
set :sessions, true
|
||||
|
||||
get '/' do
|
||||
redirect "/readme.md"
|
||||
end
|
||||
|
||||
get '/:name' do
|
||||
markdown File.read(params['name']), layout_engine: :erb, layout: true
|
||||
end
|
||||
class ExampleApp < TonTonWeb::App
|
||||
set :root, Pathname.new(__FILE__).parent.parent
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue