v0.19: http server #1454
No reviewers
Labels
No labels
UX
active development
backlog
blocker
bootstrap
bounty
bug
dependencies
discussion
documentation
duplicate
enhancement
flaky test
help wanted
invalid
javascript
question
release
tendentious
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mighty-gerbils/gerbil!1454
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "v0.19-http-server"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -11,1 +11,4 @@(def __DEBUG-COMPILE(and (string? __DEBUG)(string-contains __DEBUG "compilation")))That doesn't sound very robust.
its fine, its debugging last resort.
OK, but do you have example uses of it?
The old with-id has a sandwich in a pair of
syntax-local-introduce.How does this work with only one? What effect does that achieve and how to counter it?
631a78a5eato3b5ae6b54311c6ccb44dto3bb7ff88263bb7ff8826to6257034320At this point it is done, within current scope.
Once gerbil build and ensembles have been ported, I will circle back to gxhttpd for the tests and I will also change the mux to be endpoint based similar to the new static mux. But as far as the v19 porting progression is concerned, this is done.
@ -0,0 +8,4 @@(export open-detachable-readeropen-detachable-writer)(defstruct detachable-ioWhy a struct rather than a class? This one looks like a typical trait orthogonal to many other traits.
sure, why not. it's just my default.
@ -0,0 +15,4 @@((reader :- Reader)))(defstruct (detachable-writer detachable-io)((writer :- Writer)))If these were classes, you could be both reader and writer at the same time!
@ -5,3 +5,3 @@(export #t)(def (compress-gz (file : :string)) => :string(def (compress-gzip (file : :string)) => :stringThese days, xz might be a better fit for archival, or ztd when the logs is still likely to be read.
gzip is part of core-utils, it is the saner default. user can always use a different compressor.
@ -0,0 +12,4 @@new-directory-listing-handler)(defstruct directory-handler((path :- :string)These needs comments to distinguish them, or better variable names.
ok, comments it is.
@ -0,0 +29,4 @@(string-substitute-char (stx-e #'text) #\- #\space)))))(with-identifier (handler #'status #'status "-handler")#'(def handler(empty-request-handler status))))))Shouldn't we also output the text as response? Or possibly something custom?
User-facing servers might want to add fancy pages there too, yet all the services shouldn't have to know how fancy or not the server is.
eh, let's keep the core minimal. we'll cross that bridge when we get there, no need to do it now. I will add a TODO note however.
actually I'll add the body field now, and have it empty.
done
@ -34,0 +14,4 @@(defclass Config(;; path to server root(root : :string);; list of handler modules, prefixed by mux rulesNot precise enough. Give a complete type, even if informal, e.g.
(List (Pair MuxRule (Procedure Foo Bar -> Baz))
where MuxRule is itself defined here or in the other file (but say here in which other file that is).
this is not finalized yet, i will circle back to gxhttpd later and do a better mux. no need to commit to anything yet, the mux will change.
@ -60,3 +69,3 @@(save-config! cfg (or (hash-get opt 'config) (httpd-config-path)))))(def (set-ensemble-config! opt cfg);; (def (set-ensemble-config! opt cfg)Hopefully, the ensemble stuff would go to a separate file.
yeah, it will be revisited.
@ -0,0 +8,4 @@(export #t);; TODO add a body field to allow fancy servers to custom the;; default empty handlers with their oomph.Replace this TODO by a comment on the body field
ah yes, sorry