This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-04
Channels
- # announcements (6)
- # babashka (7)
- # beginners (2)
- # biff (5)
- # calva (2)
- # cherry (17)
- # cider (3)
- # clj-kondo (8)
- # clojure (202)
- # clojure-brasil (8)
- # clojure-europe (20)
- # clojure-norway (23)
- # clojure-uk (4)
- # clojuredesign-podcast (5)
- # conjure (1)
- # cursive (9)
- # eastwood (22)
- # events (8)
- # fulcro (3)
- # hyperfiddle (22)
- # introduce-yourself (7)
- # lsp (67)
- # malli (1)
- # matrix (1)
- # meander (6)
- # off-topic (76)
- # pedestal (8)
- # polylith (17)
- # quil (12)
- # re-frame (2)
- # reagent (8)
- # releases (3)
- # shadow-cljs (67)
- # sql (93)
- # squint (39)
- # tools-deps (46)
- # vim (7)
Hello! I'm using fast-resource
interceptor to serve static resources (in order to have the index?
functionality).
While developing this seems to work (as it serves resources from the filesystem) but when used from within an uberjar, I get a clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException in Interceptor :io.pedestal.http.ring-middlewares/fast-resource - Not a file: jar:file:/path/to/app.jar!/public/
Is this intended? If so shouldn't the interceptor be named fast-file
instead of fast-resource
?
Here seems that ::http/type
can be only a keyword
https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http.clj#L312
Here seems that ::http/type
can be a keyword or a function
https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http.clj#L343
It seems wired to me.
Yes, I'm working on that, and introducing schemas to properly describe and validate what all the options are.
Should be keyword or function, and I'm updating docs to lean towards function, not keyword. Better for AOT compilation and such.
if ::http/type
is a function, it requires ::http/chain-provider
::http/chain-provider
is a function service-map -> service-map
that should assoc a new keys, usually ::http/service-fn
etc into service-map
::http/type
is a function service-map options -> srv-description
, where options
contains keys like :port
, and srv-description
should contins at least :server :start-fn :stop-fn
I'm working in a new HTTP backend for pedestal 🙂
Mostly for learning//fun
btw, service-map->server-options//server-map->service-map
functions makes the code way harder to browse, once you can't use find keyword usages
I don't want to disparage the prior code owners, I'm sure there were some reasons for all of this.
btw, less then 100LOC and about 5 functions to create a new pedestal backend, from http://java.net.ServerSocket.
for sure a wrong and incomplete server (still not writing headers, etc). but a nice experience