#!/usr/bin/env ruby
# -*- coding: utf-8; -*-
#
# server: script for running standalone tdiary cgi server.
#
# Copyright (C) 2008-2010, Kakutani Shintaro <shintaro@kakutani.com>
# You can redistribute it and/or modify it under GPL2.

$:.unshift( File.expand_path( "../lib", File.dirname(__FILE__) ).untaint )
require 'server'
require 'optparse'

params = ARGV.getopts('d', 'p:')
opts = {:daemon => params['d'], :port => params['p'] || 19292 }

TDiary::StandaloneCGIServer.run( opts )
