Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fierycod/holy-lambda-ring-adapter
An adapter between Ring core request/response model and Holy Lambda. Run Ring applications on AWS Lambda :fire:
https://github.com/fierycod/holy-lambda-ring-adapter
aws-lambda clojure holy-lambda ring
Last synced: 3 months ago
JSON representation
An adapter between Ring core request/response model and Holy Lambda. Run Ring applications on AWS Lambda :fire:
- Host: GitHub
- URL: https://github.com/fierycod/holy-lambda-ring-adapter
- Owner: FieryCod
- License: mit
- Created: 2021-10-05T07:47:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-24T18:42:14.000Z (over 1 year ago)
- Last Synced: 2024-05-01T19:53:07.570Z (9 months ago)
- Topics: aws-lambda, clojure, holy-lambda, ring
- Language: Clojure
- Homepage:
- Size: 119 KB
- Stars: 36
- Watchers: 3
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Rationale
I wanted to create a library that allows to use known Clojure tools to develop API's on AWS Lambda.**A library that**
- prevents AWS to vendor lock you with Lambda,
- allows for fast feedback loop while developing API locally,
- implements a full Ring spec,
- supports serving resources from AWS Lambda,
- is fast, so that cold starts are minimalThis is why holy-lambda-ring-adapter was released. An adapter is a part of holy-lambda project and is already used in production.
## Compatibility
- AWS ApiGateway Lambda Integration
- [HttpApi](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop.html#http-api-examples)
- [RestApi](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html)
- Java Version >= 11 or Babashka >= 0.8.2
- GraalVM Native Image >= 21.2.0
- Holy Lambda >= 0.6.0 [all backends: [native](https://fierycod.github.io/holy-lambda/#/native-backend-tutorial), [babashka](https://fierycod.github.io/holy-lambda/#/babashka-backend-tutorial), [clojure](https://fierycod.github.io/holy-lambda/#/clojure-backend-tutorial)## Usage
- **With plain [ring](https://github.com/ring-clojure/ring)**
```clojure
(ns core
(:require
[fierycod.holy-lambda-ring-adapter.core :as hlra]
[fierycod.holy-lambda.core :as h])
(defn ring-handler
[request]
{:status 200
:headers {}
:body \"Hello World\"})
(def HttpApiProxyGateway (hlra/ring<->hl-middleware ring-handler))
(h/entrypoint [#'HttpApiProxyGateway])
```
- **With Reitit & Muuntaja [reitit](https://github.com/metosin/reitit)**
```clojure
(ns core
(:require
[fierycod.holy-lambda-ring-adapter.core :as hlra]
[fierycod.holy-lambda.core :as h])
(def muuntaja-ring-handler
(ring/ring-handler
(ring/router
routes
{:data {:muuntaja instance
:coercion coerction
:middleware middlewares}})))
(def HttpApiProxyGateway (hlra/ring<->hl-middleware muuntaja-ring-handler))
(h/entrypoint [#'HttpApiProxyGateway])
```## Companies & Inviduals using Holy Lambda Ring Adapter?
- [retailic](https://retailic.com/)
## Documentation
The holy-lambda documentation is available [here](https://fierycod.github.io/holy-lambda).## Current Version
[![Clojars Project](https://img.shields.io/clojars/v/io.github.FieryCod/holy-lambda-ring-adapter?labelColor=283C67&color=729AD1&style=for-the-badge&logo=clojure&logoColor=fff)](https://clojars.org/io.github.FieryCod/holy-lambda-ring-adapter)## Getting Help
[![Get help on Slack](http://img.shields.io/badge/slack-clojurians%20%23holy--lambda-97C93C?labelColor=283C67&logo=slack&style=for-the-badge)](https://clojurians.slack.com/channels/holy-lambda)## License
Copyright © 2021 Karol Wojcik aka FierycodReleased under the MIT license.