Skip to content

Instantly share code, notes, and snippets.

@ltw
Last active December 22, 2015 22:19
Show Gist options
  • Select an option

  • Save ltw/6539620 to your computer and use it in GitHub Desktop.

Select an option

Save ltw/6539620 to your computer and use it in GitHub Desktop.
(import '[org.eclipse.jetty.server.handler GzipHandler])
(defn- configurator [server]
"Ask Jetty to gzip."
(.setHandler server
(doto (new GzipHandler)
(.setMimeTypes "text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,text/javascript,image/svg+xml,application/json,application/clojure")
(.setHandler (.getHandler server)))))
(run-jetty #'app {:port port :join? false :configurator configurator})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment