Skip to content

mcohen01/crowbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

crowbar

Rollbar Ring middleware and Clojure rest client.

Installation

Leiningen coordinates:

[crowbar "0.1.0-SNAPSHOT"]

Usage

(ns com.example
  (:require [crowbar.core :as cb]))

(def rollbar (cb/rollbar "abcdef0123456789abcdef0123456789" "production"))

(try
  ("nofn")
  (catch Exception e
    (rollbar e)))

(try
  ("nofn")
  (catch Exception e
    (rollbar e "critical")))


(rollbar "just some message")

(rollbar "just some message" "debug")

Ring middleware

(ns com.example
  (:require [crowbar.middleware :as cb]
            [org.httpkit.server :as http]
            [compojure.core     :refer :all]
            [compojure.handler  :refer :all]))

(defroutes web-routes
  (GET "/test" [foo]
    (println foo)
    (if (= foo "bar") (throw (RuntimeException.)))
    "ok"))

(def handler (-> web-routes
                 api
                 (cb/rollbar "abcdef0123456789abcdef0123456789" "production")))

(future (http/run-server #'handler {:port 8000}))

License

Copyright © 2013 Michael Cohen

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

About

Rollbar Ring middleware and Clojure rest client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published