stream-iori / ring-vertx-adapter

The adapter of Ring for Vert.x
11 stars 3 forks source link

ring-vertx-adapter

The adapter of Ring for Vert.x

This project dependency lib of io.vertx/clojure-api

Simply example:

;;we use Compojure as router 
(defroutes app
   (GET "/" [] "<h1>Hello World</h1>")
   (route/not-found "<h1>Page not found</h1>"))

(ring-vertx/run-vertx-web (http/server) app "localhost" 8080)

full example see src/example/http_server.

Run with Vert.x

Well, default example of running ring-vertx-adapter is embeded. if you wanna it run with vertx's command such as vertx run core.clj. you should know something.

Well, you also could use command run directly if you set classpath.

vertx run core.clj -cp classes:lib/ring-vertx-adapter.jar