https://github.com/duct-framework/server.http.aleph
Integrant methods for running an Aleph web server
https://github.com/duct-framework/server.http.aleph
aleph clojure duct integrant ring
Last synced: 5 months ago
JSON representation
Integrant methods for running an Aleph web server
- Host: GitHub
- URL: https://github.com/duct-framework/server.http.aleph
- Owner: duct-framework
- Created: 2017-06-06T02:47:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T11:46:27.000Z (over 4 years ago)
- Last Synced: 2025-07-10T02:35:52.870Z (6 months ago)
- Topics: aleph, clojure, duct, integrant, ring
- Language: Clojure
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Duct server.http.aleph
[](https://travis-ci.org/duct-framework/server.http.aleph)
Integrant multimethods for running an [Aleph][] HTTP server for the
[Duct][] framework.
[aleph]: http://aleph.io/
[duct]: https://github.com/duct-framework/duct
## Installation
To install, add the following to your project `:dependencies`:
[duct/server.http.aleph "0.1.2"]
## Usage
This library adds Integrant methods that dispatch off the
`:duct.server.http/aleph` key, which is derived from
`:duct.server/http`. The corresponding value is a map of options for
the [Aleph Ring adapter][], plus a `:handler` key that takes a handler
function.
For example:
```clojure
{:duct.server.http/aleph
{: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
[aleph ring adapter]: http://aleph.io/aleph/http.html
[duct.logger]: https://github.com/duct-framework/logger
## License
Copyright © 2017 James Reeves
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.