This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-06
Channels
- # babashka (19)
- # beginners (68)
- # calva (9)
- # cider (27)
- # clj-kondo (64)
- # clj-on-windows (2)
- # cljdoc (8)
- # clojure (11)
- # clojure-europe (58)
- # clojure-italy (1)
- # clojure-nl (23)
- # clojure-uk (5)
- # clojurescript (9)
- # cryogen (18)
- # cursive (14)
- # data-science (17)
- # emacs (6)
- # gorilla (6)
- # graphql (1)
- # gratitude (2)
- # holy-lambda (10)
- # introduce-yourself (1)
- # jackdaw (3)
- # jobs (1)
- # leiningen (2)
- # malli (3)
- # missionary (33)
- # off-topic (21)
- # pedestal (7)
- # polylith (8)
- # quil (3)
- # random (1)
- # releases (1)
- # remote-jobs (7)
- # shadow-cljs (18)
- # specter (1)
- # sql (8)
sounds like you’re talking about content negotiation. http://pedestal.io/api/pedestal.service/io.pedestal.http.content-negotiation.html
Yeah I believe so. I think my question is more architecture based opposed to pedestal but that is indeed what I'm after. I'll take a look and I'm still trying to decide how I'm going to handle this. I'm looking to both create static pages and more dynamic pages.
What I do is just use the built-in Pedestal interceptor for content negotation. Then I have a map of content-type->body-fn
for the endpoint in question which is used by the handler (and the keys of the map are used by the content-negotiation interceptor). The endpoint then just creates content based on the negotiated content type.
Here’s what it looks like: https://github.com/kuhumcst/glossematics/blob/feature/meeting-prep-2/src/dk/cst/glossematics/backend/files.clj#L37-L78
Exactly what I wanted. I was also wondering if this could be done using multimethods in some way. I was watching a video on Clojurescript and that popped into my mind as a possible solution. Newbie thoughts…. But yes you're doing exactly what I want. I'm over engineering a cms and from my view the page will be fairly dynamic but I'd like to create static pages server side as well.
Glad I could help. Yup, multi-methods can be used too, but personally I rarely use them since I prefer simpler things such as maps. I guess if you nee extensibility, multi-methods are the better choice.
there is a guide: http://pedestal.io/guides/hello-world-content-types
Exactly what I wanted. I was also wondering if this could be done using multimethods in some way. I was watching a video on Clojurescript and that popped into my mind as a possible solution. Newbie thoughts…. But yes you're doing exactly what I want. I'm over engineering a cms and from my view the page will be fairly dynamic but I'd like to create static pages server side as well.