Permalink
Browse files

code reloading. man that was easy

  • Loading branch information...
jneen committed Jan 12, 2011
1 parent 5c91ce4 commit 9381757ae0e53e40c549e3e3ac0c7c02f6f2be02
Showing with 7 additions and 4 deletions.
  1. +0 −1 lib/balls.sh
  2. +2 −3 lib/router.sh
  3. +5 −0 lib/server.sh
View
@@ -20,4 +20,3 @@
. $BALLS_LIB/server.sh
. $BALLS_LIB/view.sh
-. $BALLS_ACTIONS/*.sh
View
@@ -20,9 +20,8 @@ b:PUT() { balls::define_route PUT "$@" ;}
b:DELETE() { balls::define_route DELETE "$@" ;}
balls::route() {
- if [[ "$REQUEST_METHOD" = "HEAD" ]]; then
- body_sock=/dev/null
- fi
+ [[ "$BALLS_RELOAD" = 1 ]] && balls::load_app
+ [[ "$REQUEST_METHOD" = "HEAD" ]] && body_sock=/dev/null
local action=$(
echo "$ROUTES" | grep "^$REQUEST_METHOD" | {
View
@@ -5,6 +5,7 @@ _hash() {
}
balls::server() {
+ balls::load_app
http_sock=$BALLS_TMP/balls.http.$$.sock
[ -p $http_sock ] || mkfifo $http_sock
@@ -21,3 +22,7 @@ cleanup() {
}
trap 'cleanup; exit' INT
+
+balls::load_app() {
+ . $BALLS_ACTIONS/*.sh
+}

0 comments on commit 9381757

Please sign in to comment.