Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

code reloading. man that was easy

  • Loading branch information...
commit 9381757ae0e53e40c549e3e3ac0c7c02f6f2be02 1 parent 5c91ce4
@jneen authored
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
1  lib/balls.sh
@@ -20,4 +20,3 @@
. $BALLS_LIB/server.sh
. $BALLS_LIB/view.sh
-. $BALLS_ACTIONS/*.sh
View
5 lib/router.sh
@@ -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 lib/server.sh
@@ -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
+}
Please sign in to comment.
Something went wrong with that request. Please try again.