Coder Social home page Coder Social logo

server.http.aleph's Introduction

Duct server.http.aleph

Build Status

Integrant multimethods for running an Aleph HTTP server for the Duct framework.

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:

{: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

License

Copyright © 2017 James Reeves

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

server.http.aleph's People

Contributors

weavejester avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

server.http.aleph's Issues

aleph is not compatible with module.web's ring middleware

I have received some errors that never appear when using default jetty adapter or httpkit. After some research, it is because aleph is not compatible with all ring middlewares that modified response (e.g. update header). It should be mentioned in document, since it means it is not fully compatible with module.web ( ring-defaults...) out-of-the-box.

java.lang.ClassCastException: manifold.deferred.Deferred cannot be cast to clojure.lang.Associative
                  RT.java:820 clojure.lang.RT.assoc
                 core.clj:191 clojure.core/assoc
                core.clj:6089 clojure.core/assoc-in
                core.clj:6081 clojure.core/assoc-in
              response.clj:71 ring.util.response/header
              response.clj:68 ring.util.response/header
             response.clj:172 ring.util.response/content-type
             response.clj:168 ring.util.response/content-type
          content_type.clj:16 ring.middleware.content-type/content-type-response
           content_type.clj:6 ring.middleware.content-type/content-type-response
          content_type.clj:34 ring.middleware.content-type/wrap-content-type[fn]
       default_charset.clj:31 ring.middleware.default-charset/wrap-default-charset[fn]
          not_modified.clj:53 ring.middleware.not-modified/wrap-not-modified[fn]
             x_headers.clj:22 ring.middleware.x-headers/wrap-x-header[fn]
             x_headers.clj:22 ring.middleware.x-headers/wrap-x-header[fn]
             x_headers.clj:22 ring.middleware.x-headers/wrap-x-header[fn]
                   web.clj:28 duct.middleware.web/wrap-log-requests[fn]
                   web.clj:39 duct.middleware.web/wrap-log-errors[fn]
            stacktrace.clj:26 ring.middleware.stacktrace/wrap-stacktrace-log[fn]
            stacktrace.clj:96 ring.middleware.stacktrace/wrap-stacktrace-web[fn]
                 aleph.clj:13 duct.server.http.aleph/eval69978[fn]
               server.clj:158 aleph.http.server/handle-request[fn]
                  AFn.java:22 clojure.lang.AFn.run
             Executor.java:62 io.aleph.dirigiste.Executor$Worker$1.run
              executor.clj:44 manifold.executor/thread-factory[fn]
                  AFn.java:22 clojure.lang.AFn.run
              Thread.java:844 java.lang.Thread.run

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.