Sha256: 50203a18edaff18ab44608795cd1dbcec3dad7536adb8f629171207428ce950b

Contents?: true

Size: 575 Bytes

Versions: 1

Compression:

Stored size: 575 Bytes

Contents

require 'sinatra'
require_relative '../lib/skeleton/root'

server_port = ARGV[0]
set :port, server_port

File.open("#{Base::ROOT_DIR}/server/port", 'w+') { |f| f.write(server_port) }

get '/' do
  redirect "skeleton"
end

get '/:file' do
  domain = params[:file].split('.').last
  file = domain == params[:file] ? "#{domain}.html" : params[:file]
  send_file "#{Base::ROOT_DIR}/server/#{file}"
end

post '/:file' do
  domain = params[:file].split('.').last
  file = domain == params[:file] ? "#{domain}.html" : params[:file]
  send_file "#{Base::ROOT_DIR}/server/#{file}"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skeleton-ui-0.1.11 server/server.rb