sauercrowd / clojureworker

https://clojars.org/com.github.sauercrowd/clojureworker
MIT License
16 stars 2 forks source link
clojure clojurescript cloudflare-workers workers

clojureworker

Clojars Project

A Clojurescript library to simplify the use with Cloudflare workers, focusing on simplicity.

Usage

Clojureflare currently provides three functions, documented here.

The Handler

The handler can currently be one of three types:

The request is of the form of

{:path "/test" :body "{\"key\":1}" :headers {}}

while the response map should similar to

{:body "{\"key\":1}" :headers {"Content-Type" "application/json"} :status 200}

Additionally the handler function can return a promise which eventually resolves to the described map.

Example Worker

Head over to the example-worker to create your first Clojurescript worker.