          (regions-by-tables (:regions @cached)
                             (keyword metric))))
   (PUT "/move_region" {{:keys [src dest region]} :params}
+       (when @read-only?
+         (throw (Exception. "Read-only mode. Not allowed.")))
        (hbase/admin-let
          [admin @zookeeper]
          (.move admin (.getBytes region) (.getBytes dest))

(ns hbase-region-inspector.core
  (:require [clojure.pprint :refer [pprint]]
            [ring.adapter.jetty :refer [run-jetty]]
            [ring.util.response :refer [response content-type resource-response]]
            [ring.middleware.defaults :refer [wrap-defaults api-defaults site-defaults]]

(defroutes app-routes
  (GET "/" []
       (render-file "public/index.html" {:zookeeper @zookeeper
                                         :read-only @read-only?
                                         :updated-at (:updated-at @cached)}))
       ;; (content-type (resource-response "index.html" {:root "public"})
       ;;               "text/html"))
