Prepare for support for code reloading
This commit is contained in:
parent
ac13e7bc27
commit
5a717489d2
2
TODO.md
2
TODO.md
|
@ -1,5 +1,7 @@
|
||||||
Documentation/help text on the edit package page?
|
Documentation/help text on the edit package page?
|
||||||
|
|
||||||
|
Move `generic-input` and friends into bootstrap.rkt
|
||||||
|
|
||||||
Somehow present all the tags available for filtering on the search page
|
Somehow present all the tags available for filtering on the search page
|
||||||
- maybe just a big list?
|
- maybe just a big list?
|
||||||
- maybe checkboxes?
|
- maybe checkboxes?
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
bootstrap-response
|
bootstrap-response
|
||||||
bootstrap-redirect
|
bootstrap-redirect
|
||||||
|
bootstrap-continuation-expiry-handler
|
||||||
|
|
||||||
add-classes
|
add-classes
|
||||||
glyphicon)
|
glyphicon)
|
||||||
|
@ -90,6 +91,18 @@
|
||||||
#:headers (append (map cookie->header (bootstrap-cookies))
|
#:headers (append (map cookie->header (bootstrap-cookies))
|
||||||
headers)))
|
headers)))
|
||||||
|
|
||||||
|
;; Request -> Response
|
||||||
|
(define (bootstrap-continuation-expiry-handler request)
|
||||||
|
(bootstrap-redirect (url->string (strip-parameters (request-uri request)))))
|
||||||
|
|
||||||
|
;; URL -> URL
|
||||||
|
(define (strip-parameters u)
|
||||||
|
(struct-copy url u
|
||||||
|
[path (map (lambda (element)
|
||||||
|
(struct-copy path/param element
|
||||||
|
[param '()]))
|
||||||
|
(url-path u))]))
|
||||||
|
|
||||||
;; (Listof (U Symbol String)) XExpr -> XExpr
|
;; (Listof (U Symbol String)) XExpr -> XExpr
|
||||||
(define (add-classes classes x)
|
(define (add-classes classes x)
|
||||||
(define class-strs (map (lambda (c) (if (symbol? c) (symbol->string c) c)) classes))
|
(define class-strs (map (lambda (c) (if (symbol? c) (symbol->string c) c)) classes))
|
||||||
|
|
|
@ -4,26 +4,11 @@
|
||||||
|
|
||||||
(require web-server/servlet-env)
|
(require web-server/servlet-env)
|
||||||
(require web-server/managers/lru)
|
(require web-server/managers/lru)
|
||||||
(require web-server/http/request-structs)
|
|
||||||
(require net/url)
|
|
||||||
(require "signals.rkt")
|
|
||||||
(require "bootstrap.rkt")
|
|
||||||
|
|
||||||
(define (strip-parameters u)
|
|
||||||
(struct-copy url u
|
|
||||||
[path (map (lambda (element)
|
|
||||||
(struct-copy path/param element
|
|
||||||
[param '()]))
|
|
||||||
(url-path u))]))
|
|
||||||
|
|
||||||
(define (default-expiry-handler request)
|
|
||||||
(bootstrap-redirect (url->string (strip-parameters (request-uri request)))))
|
|
||||||
|
|
||||||
(define (start-service #:port [port 8443]
|
(define (start-service #:port [port 8443]
|
||||||
#:ssl? [ssl? #t]
|
#:ssl? [ssl? #t]
|
||||||
#:on-continuation-expiry [on-continuation-expiry default-expiry-handler]
|
request-handler-function
|
||||||
request-handler-function)
|
on-continuation-expiry)
|
||||||
(start-restart-signal-watcher)
|
|
||||||
(serve/servlet request-handler-function
|
(serve/servlet request-handler-function
|
||||||
#:launch-browser? #f
|
#:launch-browser? #f
|
||||||
#:quit? #f
|
#:quit? #f
|
||||||
|
|
1043
src/main.rkt
1043
src/main.rkt
File diff suppressed because it is too large
Load Diff
1041
src/site.rkt
Normal file
1041
src/site.rkt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user