Cmd-Dwarf

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


        % dir=${dwarf_cloned_dir}
        % mkdir hello_world
        % perl ${dir}/bin/dwarf --share_dir=${dir}/share --output=. hello_world
        created ./hello_world/app
        created ./hello_world/htdocs

## èµ·å‹•

デフォルトでは plackup で起動します。<br />
オプション -m に production と指定することで starman で起動します。<br />
この起動スクリプトは自由に編集して使われることを想定しています。

        % cd hello_world/app
        % ./script/start_searver.sh

## プロジェクト構造

Dwarf は「プロジェクト毎に使い捨てる」という思想で作られています。<br />
よってフレームワーク本体もローカルに置かれるのが特徴です。

examples/helloworld/app/script/start_server.sh  view on Meta::CPAN

#!/bin/sh
ROOT=${0%/*}/..
PID=$ROOT/starman.pid
PSGI=$ROOT/app.psgi
HOST=0.0.0.0
PORT=11022
MODE=debug
LOCAL=NO
USE_CARTON=0

# オプションをハンドリング
while getopts m:lch opt
do

examples/helloworld/app/script/start_server.sh  view on Meta::CPAN

	       ;;
	l )    LOCAL=YES
	       ;;
	c )    USE_CARTON=1
	       ;;
	h )    echo '% ./start_server.sh [<option>]
version 1.0
    	
option:
    -m mode
       if you pass production then this run starman. if not, this run plackup'
		   exit
		   ;;
    ? )    echo 'Usage -h'
		   exit
		   ;;
	esac
done

if [ ${LOCAL} = 'YES' ]
then

examples/helloworld/app/script/start_server.sh  view on Meta::CPAN

fi

if [ ${USE_CARTON} = '1' ]
then
	CARTON="local/bin/carton exec"
fi

cd $ROOT
if [ ${MODE} = 'production' ]
then
	$CARTON starman -I local/lib/perl5 -I lib -l $HOST:$PORT --pid $PID $PSGI
else
	$CARTON plackup -I local/lib/perl5 -I lib -R lib,tmpl --host $HOST --port $PORT $PSGI
fi

examples/test-validate-json-body/app/script/start_server.sh  view on Meta::CPAN

#!/bin/sh
ROOT=${0%/*}/..
PID=$ROOT/starman.pid
PSGI=$ROOT/app.psgi
HOST=0.0.0.0
PORT=11022
MODE=debug
LOCAL=NO
USE_CARTON=0

# オプションをハンドリング
while getopts m:lch opt
do

examples/test-validate-json-body/app/script/start_server.sh  view on Meta::CPAN

	       ;;
	l )    LOCAL=YES
	       ;;
	c )    USE_CARTON=1
	       ;;
	h )    echo '% ./start_server.sh [<option>]
version 1.0
    	
option:
    -m mode
       if you pass production then this run starman. if not, this run plackup'
		   exit
		   ;;
    ? )    echo 'Usage -h'
		   exit
		   ;;
	esac
done

if [ ${LOCAL} = 'YES' ]
then

examples/test-validate-json-body/app/script/start_server.sh  view on Meta::CPAN

fi

if [ ${USE_CARTON} = '1' ]
then
	CARTON="local/bin/carton exec"
fi

cd $ROOT
if [ ${MODE} = 'production' ]
then
	$CARTON starman -I local/lib/perl5 -I lib -l $HOST:$PORT --pid $PID $PSGI
else
	$CARTON plackup -I local/lib/perl5 -I lib -R lib,tmpl --host $HOST --port $PORT $PSGI
fi

share/app/script/start_server.sh  view on Meta::CPAN

#!/bin/sh
ROOT=${0%/*}/..
PID=$ROOT/starman.pid
PSGI=$ROOT/app.psgi
HOST=0.0.0.0
PORT=11022
MODE=debug
LOCAL=NO
USE_CARTON=0

# オプションをハンドリング
while getopts m:lch opt
do

share/app/script/start_server.sh  view on Meta::CPAN

	       ;;
	l )    LOCAL=YES
	       ;;
	c )    USE_CARTON=1
	       ;;
	h )    echo '% ./start_server.sh [<option>]
version 1.0
    	
option:
    -m mode
       if you pass production then this run starman. if not, this run plackup'
		   exit
		   ;;
    ? )    echo 'Usage -h'
		   exit
		   ;;
	esac
done

if [ ${LOCAL} = 'YES' ]
then

share/app/script/start_server.sh  view on Meta::CPAN

fi

if [ ${USE_CARTON} = '1' ]
then
	CARTON="local/bin/carton exec"
fi

cd $ROOT
if [ ${MODE} = 'production' ]
then
	$CARTON starman -I local/lib/perl5 -I lib -l $HOST:$PORT --pid $PID $PSGI
else
	$CARTON plackup -I local/lib/perl5 -I lib -R lib,tmpl --host $HOST --port $PORT $PSGI
fi



( run in 0.719 second using v1.01-cache-2.11-cpan-e93a5daba3e )