weavejester / ring-jetty-component

A component for the standard Ring Jetty adapter
32 stars 3 forks source link

Remove dependency on :app key #2

Closed viesti closed 9 years ago

viesti commented 9 years ago

Firstly, I really like duct and these small components that go together, thanks for your work! :)

I might be a little off here, but tried out using ring-jetty-component on an application that primary was not a web server. My main component was behind :app key in the system map, but seems that ring-jetty-component reserves this particular keyword for it's own use, see line 11 in jetty.clj

https://github.com/weavejester/ring-jetty-component/blob/master/src/ring/component/jetty.clj#L11

I initially used :app key in the system map for another component, but got things working by giving :app key for the ring handler component created by duct.component.handler/handler-component.

So it seems that ring.component.jetty/JettyServer relies on :app keyword being given to the handler component.

Don't have an obvious fix in my mind though :/

weavejester commented 9 years ago

The :app key is the local key for the component. It doesn't necessarily have to be the same as the system key. For example:

(component/using (jetty-server {:port 3000}) {:app :http-app})

This binds the key :http-app on the system to :app on the Jetty server component.

viesti commented 9 years ago

Ah, rookie mistake :)