Skip to content

Instantly share code, notes, and snippets.

@kognate
Created January 2, 2013 17:37
Show Gist options
  • Save kognate/4436378 to your computer and use it in GitHub Desktop.
Save kognate/4436378 to your computer and use it in GitHub Desktop.
(ns immutant.init
(:use irxcontrolcenter.core)
(:require [immutant.messaging :as messaging]
[immutant.web :as web]
[immutant.util :as util]
[ring.middleware.resource :as ring-resource])
)
;; This file will be loaded when the application is deployed to Immutant, and
;; can be used to start services your app needs. Examples:
;; Web endpoints need a context-path and ring handler function. The context
;; path given here is a sub-path to the global context-path for the app
;; if any.
(defn not-found [request]
{:status 404
:header {"Content-Type" "text/plain"}
:body (str "file not found at " request)})
(web/start "/" app :reload true)
(web/start "/js" (ring-resource/wrap-resource not-found "public/js"))
;; To start a Noir app:
; (server/load-views (util/app-relative "src/irxcontrolcenter/views"))
; (web/start "/" (server/gen-handler {:mode :dev :ns 'irxcontrolcenter}))
;; Messaging allows for starting (and stopping) destinations (queues & topics)
;; and listening for messages on a destination.
; (messaging/start "/queue/a-queue")
; (messaging/listen "/queue/a-queue" #(println "received: " %))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment