mirror of
https://github.com/ticky/wayback-classic.git
synced 2025-12-26 07:28:03 -05:00
18 lines
600 B
Ruby
Executable File
18 lines
600 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
require_relative '../cgi-bin/lib/web_client/cache'
|
|
require 'webrick'
|
|
|
|
WEBrick::HTTPServer.new(Port: ENV.fetch('PORT', 8000),
|
|
DocumentRoot: File.expand_path('..', __dir__),
|
|
# https://memo88.hatenablog.com/entry/20130309/1362849357, ありがとうございます!
|
|
CGIInterpreter: '/usr/bin/ruby -Eutf-8:utf-8').tap do |server|
|
|
trap 'INT' do
|
|
server.shutdown
|
|
end
|
|
|
|
server.logger.info "WaybackClassic::WebClient::Cache.cache_dir = \"#{WaybackClassic::WebClient::Cache.cache_dir}\""
|
|
|
|
server.start
|
|
end
|