Skip to content

jamesaddinall/jetty-component

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jetty-component

A Component[1] that runs a ring-servlet with Servlet 3 API.

[1] https://github.com/stuartsierra/component

Artifacts

jetty-component artifacts are released to Clojars.

If you are using Maven, add the following repository definition to your pom.xml:

<repository>
  <id>clojars.org</id>
  <url>http://clojars.org/repo</url>
</repository>

The Most Recent Release

With Leiningen:

[com.andrewmcveigh/jetty-component "0.1.1"]

The most recent release can be found on Clojars.

Usage

A component is a discrete piece of a system. This component needs a port, and a ring handler. The :app should assoc a :handler to the component map.

(require '[com.stuartsierra.component :as component])
(require '[component.jetty :as jetty])

(defrecord RingApp []
  component/Lifecycle
  (start [component]
    (assoc component :handler ring-handler))
  (stop [component] ...))

(component/system-map
  :schedule ...
  :app (component/using (->RingApp) [:schedule :db])
  :server (component/using (jetty/web-server 8080) [:app])
  :db ...)

License

Copyright © 2014 Andrew Mcveigh

Distributed under the Eclipse Public License, the same as Clojure.

About

A Jetty Servlet 3 'Component'

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Clojure 100.0%