What is Pedestal?
Pedestal is a sturdy and reliable base for services, APIs, and applications. Pedestal runs in the back-end and can handle anything from tiny static web sites, to traditional page oriented applications, to dynamic single page applications utilizing server-sent events and WebSockets.
Pedestal was created to bring Clojure’s key attributes, Focus, Empowerment, and Simplicity, to the domain of Clojure web development.
(ns front-page
(:require [io.pedestal.connector :as conn]
[io.pedestal.http.http-kit :as hk]))
(defn- greet-handler
[_request]
{:status 200
:body "Hello, world!"})
(defn start!
[]
(-> (conn/default-connector-map 8080)
(assoc :join? true)
(conn/with-default-interceptors)
(conn/with-routes
#{["/greet" :get greet-handler]})
(hk/create-connector nil)
(conn/start!)))
Pedestal applications can start tiny, but Pedestal scales up with your needs.
This documentation is for Pedestal version 0.8.0-alpha-1.
Pedestal requires Clojure 1.11 or later.
Pedestal provides integrations with:
... with more integrations coming.
Features
Ready for Production
Pedestal runs where Java runs: Applications can be deployed as standalone Clojure applications, or as WAR files in a servlet container. Pedestal integrates with Open Telemetry to give you visibility into your running services.
Secure By Default
Pedestal automatically uses secure headers, enables cross site request forgery protection, and other best practices.
It works with cross-origin resource sharing to allow secure front end applications.
Easy Ramp Up
A simple Pedestal app fits into a few lines of Clojure; Pedestal includes a deps-new template for getting you started. When you need more power, it’s ready for you.
Testable
Pedestal embraces testability as a first-class concern. The core interceptor model breaks request processing into small pieces that are simple, often free of side effects, and therefore easy to test; then lets you stack those pieces up to form your full application. Pedestal provides a testing API that can fully exercise your synchronous and asynchrounous code without actually starting a web server.