Questions tagged [pedestal]

An open source tool set for building web applications in Clojure

Pedestal is a Clojure framework that comes ready-made for developers to solve difficult problems . In a single language, from client to server and back. By providing the leading Clojure web development libraries, Pedestal gives developer the building blocks for robust web applications.

Pedestal gives developers a solid foundation to build highly scalable backend services.

Pedestal is an open framework that gives Clojure developers well-designed libraries to save time and effort.

58 questions
3
votes
1 answer

Clojure pedestal.io code is not resolved in IntelliJ

I have a small application of Clojure and Pedestal that I grabbed from pedestal.io tutorial. It works fine in the terminal. When I open it in IntelliJ some "cannot be resolved" tips are appearing. And some code parts are getting a beige…
trzczy
  • 1,325
  • 2
  • 18
  • 43
3
votes
1 answer

How to render HTML templates in Pedestal?

I am going over the Pedestal docs at https://github.com/pedestal/pedestal/tree/master/guides/documentation There are no examples for how to render html from templates. Does pedestal even have this functionality? If so, can anyone please explain…
Zuriar
  • 11,096
  • 20
  • 57
  • 92
3
votes
2 answers

Enlive template auto-reload / detect changes in a Pedestal service

I am using the autoreload-server example which is working great for reloading namespaces on changes to the .clj files using ns-tracker. https://github.com/pedestal/samples/blob/master/auto-reload-server/dev/dev.clj However, it is not picking up…
Tony
  • 2,037
  • 3
  • 22
  • 22
3
votes
1 answer

SSE subscribers - distributed across multiple servers?

Looking at the sse-chat demo of the Clojure Pedestal Framework - which relies on the SSE features in Pedestal - I noticed the following code: (defn publish [request] (doseq [sse-context @subscribers] (try (sse/send-event sse-context…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
2
votes
1 answer

How does one simply write an interceptor that extracts json from a get/post request using Pedestal

I am making a simple API That will require to read body parameters from a json/edn request I am trying to get the program to echo the contents as edn objects but something seems to not work here is my routes (def routes (route/expand-routes …
2
votes
2 answers

How can I forward part of requests to another server in Clojure?

Summary I am developing a server to be like a sort of a proxy in Clojure, with pedestal service + lein as a base: Receive requests Forward requests to external servers Make multiple requests server-to-server to feed a bigger json and return as a…
2
votes
0 answers

Macroexpansion error integrating integrant with pedestal

I'm trying to use the clojure library integrant with pedestal but I'm getting a strange error on compile java.lang.Thread.run Thread.java: 748 …
2
votes
1 answer

Pedestal early termination is not working

http://pedestal.io/reference/servlet-interceptor Says this Before invoking the :enter functions, the servlet interceptor sets up a "terminator" predicate on the context. It terminates the interceptor chain when the context map returned by an…
Caleb Macdonald Black
  • 1,494
  • 12
  • 17
2
votes
1 answer

UTF-8 symbols not displaying properly in browser using Pedestal

I've made simplest Pedestal project and run it in my repl locally. However, after checking browser at localhost:8890 I saw � (replacement characters) instead of actual text (cyrillic symbols) I put in my Pedestal route. I also checked in browser…
Twice_Twice
  • 527
  • 4
  • 16
2
votes
1 answer

How to get the URL query params in Pedestal?

How do I get the URL params into the request map in Pedestal? I am assuming that this needs the use of an interceptor? However the Pedestal documentation (or severe lack thereof) does not make this at all clear. Thanks.
Zuriar
  • 11,096
  • 20
  • 57
  • 92
2
votes
1 answer

How can I reload code in a Clojure pedestal repl for a quick development workflow?

I am using Pedestal (pedestal.io) and in development am running the server from inside a repl. When I make a change to the application code (such as changing the html template) how can I have the repl reflect these changes automatically upon save…
Zuriar
  • 11,096
  • 20
  • 57
  • 92
2
votes
1 answer

Clojure - test a Pedestal route

I would like to write tests for a Pedestal web-service. If I have : (defn pong [request] (ring-resp/response "pong")) (defroutes routes[[["/" {:get pong}]]]) How would I write a test for that ? (deftest alive-system (testing "ping-pong…
nha
  • 17,623
  • 13
  • 87
  • 133
2
votes
2 answers

Clojure ^shared in namespace

I am following the pedestal tutorial, and I noticed the ^shared annotation in the code, like below : (ns ^:shared tutorial-client.behavior (:require [clojure.string :as string] [io.pedestal.app.messages :as msg])) What is it…
nha
  • 17,623
  • 13
  • 87
  • 133
2
votes
1 answer

How to write a simple error interceptor?

Here's my first attempt of a catcher interceptor on Pedestal: (definterceptorfn catcher [] (interceptor :error (fn [context error] {:status 500 :body (->> error .toString (hash-map :error) json/write-str) …
konr
  • 2,545
  • 2
  • 20
  • 38
1
vote
1 answer

Clojure Pedestal Windows WSL2 browsers not rendering

I finished a pedestal clojure app and used the repl to start the server which it starts. I can only curl and can't access the project on any browser with localhost:8080. I did the frontend with Clojurescript/Shadowcljs which works fine in the…
envymike
  • 155
  • 2
  • 7