Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andimiller/http4s-cgi
https://github.com/andimiller/http4s-cgi
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/andimiller/http4s-cgi
- Owner: andimiller
- Created: 2022-11-16T22:55:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-01T17:30:28.000Z (almost 2 years ago)
- Last Synced: 2023-08-13T19:19:26.771Z (over 1 year ago)
- Language: Scala
- Size: 99.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# http4s-cgi
This is an `http4s-server` backend which implements `CGI`, and is intended to be used with `scala-native`.
## Motivation
`AWS Lambda` is the hot new thing, and it seems like `CGI` to me, so I've implemented `CGI` for `http4s`.
## Example
```scala
import cats.effect.IO
import net.andmiller.http4s.cgi.CgiApp
import org.http4s.dsl.io._
import org.http4s.{HttpApp, HttpRoutes}object HelloWorld extends CgiApp {
override val routes: HttpApp[IO] = HttpRoutes
.of[IO] { case GET -> Root / "hello" =>
Ok("Hello world")
}
.orNotFound
}
```## Building the examples
```shell
nix-shell -p clang
sbt -mem 4096 "project examples; nativeLink"
```## Status
I'm not too sure I'd recommend using this, but it's very fast if you want to throw a few endpoints in a `CGI` compatible web server!