https://github.com/agrison/duct-immutant
Integrant methods for running an Immutant web server
https://github.com/agrison/duct-immutant
Last synced: 2 months ago
JSON representation
Integrant methods for running an Immutant web server
- Host: GitHub
- URL: https://github.com/agrison/duct-immutant
- Owner: agrison
- License: epl-1.0
- Created: 2018-06-20T16:55:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-20T18:42:27.000Z (almost 8 years ago)
- Last Synced: 2025-01-29T03:01:40.120Z (over 1 year ago)
- Language: Clojure
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Duct server.http.immutant
[](https://travis-ci.org/agrison/duct-immutant)
Integrant multimethods for running an [Immutant][] HTTP server for the
[Duct][] framework.
[immutant]: http://www.immutant.org
[duct]: https://github.com/duct-framework/duct
## Installation
To install, add the following to your project `:dependencies`:
[me.grison/duct-immutant "0.1.0"]
## Usage
This library adds Integrant methods that dispatch off the
`:duct.server.http/immutant` key, which is derived from
`:duct.server/http`. The corresponding value is a map of options for
the Immutant Ring adapter, plus a `:handler` key that takes a handler
function.
For example:
```clojure
{:duct.server.http/immutant
{:port 3000
:handler (fn [request]
{:status 200
:headers {"Content-Type" "text/plain"}
:body "Hello World"})}}
```
A `:logger` key may also be specified, which will be used to log when
the server starts and when it stops. The value of the key should be an
implementation of the `duct.logger/Logger` protocol from the
[duct.logger][] library
[duct.logger]: https://github.com/duct-framework/logger
## License
Copyright © 2018 Alexandre Grison
Adapted from work done by James Reeves in both
[server.http.jetty](http://github.com/duct-framework/server.http.jetty)
and [server.http.http-kit](http://github.com/duct-framework/server.http.http-kit)
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.