; start.arc - rudimentary helpers for arc web development/deployment
; Set some globals and load this at the end of an app to start on a
; specified port or provide utilities in development mode. Eg:
;
; (= port* 8002)
; (= filename* "myapp.arc")
; (= devmode* #t)
; (load "start.arc")
(def start () (new-thread (fn () (asv (or (errsafe port*) 8080)))))
(def stop () (= quitsrv* 1) "server will stop after next request")
(def reload () (load filename*))
(if (errsafe devmode*) () (start))
Enhancements welcome. Notice you have to hit the app once more with curl after calling (stop). |