Sha256: b8f31f82fa0d1b2cec74032c6af5fbdbbd51c2dfadce2ef618575c6fa6d19c0c

Contents?: true

Size: 590 Bytes

Versions: 11

Compression:

Stored size: 590 Bytes

Contents

# -*- coding: utf-8 -*-
require_relative 'app/top'
require_relative 'app/feed'
require_relative 'app/html'

module Nwiki
  module Frontend
    class App
      def initialize git_repo_path
        @builder = Rack::Builder.new {
          map '/' do
            run Top.new git_repo_path
          end
          map '/articles.xml' do
            run Feed.new git_repo_path, articles_path: '/articles'
          end
          map '/articles' do
            run Html.new git_repo_path
          end
        }
      end

      def call env
        @builder.call env
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nwiki-0.1.11 lib/nwiki/frontend/app.rb
nwiki-0.1.10 lib/nwiki/frontend/app.rb
nwiki-0.1.9 lib/nwiki/frontend/app.rb
nwiki-0.1.8 lib/nwiki/frontend/app.rb
nwiki-0.1.7 lib/nwiki/frontend/app.rb
nwiki-0.1.6 lib/nwiki/frontend/app.rb
nwiki-0.1.5 lib/nwiki/frontend/app.rb
nwiki-0.1.4 lib/nwiki/frontend/app.rb
nwiki-0.1.3 lib/nwiki/frontend/app.rb
nwiki-0.1.2 lib/nwiki/frontend/app.rb
nwiki-0.1.1 lib/nwiki/frontend/app.rb