Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 30 lines (22 sloc) 0.858 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/lib"))
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/slib"))
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/app"))

require 'pp'
require 'logger'
require 'yaml'
require 'racklib'
require 'handler/base'

Handler::Base.logger = Logger.new(STDERR)

use Rack::CommonLogger, STDOUT
use Rack::ShowExceptions

public = $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/public"))[0]
use Rack::Static, :urls => ['/javascripts', '/stylesheets', '/images', '/favicon.ico'], :root => public

PublicRoot = Proc.new { |env| [200, { 'Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=86400' }, ::File.open(public + '/index.html')] }

map '/' do
  run PublicRoot
end

# Translator Service
require 'translator'

map '/api' do
run Translator.new
end
Something went wrong with that request. Please try again.