#!/usr/bin/env ruby
# $Id: qwikweb,v 1.14 2004/05/10 08:50:33 eto Exp $
# Copyright (C) 2003-2004 Kouichirou Eto, All rights reserved.
# This is free software with ABSOLUTELY NO WARRANTY.
# You can redistribute it and/or modify it under the terms of the GNU GPL2.

base = File.dirname(__FILE__)+"/.." # /usr/local/qwik/bin -> /usr/local/qwik
$LOAD_PATH.unshift(File.expand_path(base+"/lib"))
$LOAD_PATH.unshift(File.expand_path(base+"/compat"))

require "qwik/server"

def main(argv)
  config = Qwik::Config.new
  config.parse_argv(argv)
  server = Qwik::Server.new(config)
  trap(:TERM) { server.shutdown; }
  trap(:INT)  { server.shutdown; }
  server.start
end
main(ARGV)
