                          (reduce conj! $ nested'))
                    (rest remaining)))))))
 
-
+(defn- evaluate-namespace-metadata
+  [context ns-sym]
+  (t/track
+    #(format "Loading namespace `%s'." ns-sym))
+  (try
+    (if-not (find-ns ns-sym)
+      (require ns-sym))
+    (catch Exception e
+      (throw (ex-info (format "Failed to require namespace `%s': %s"
+                              ns-sym
+                              (to-message e))
+                      {:context   context
+                       :namespace ns-sym}
+                      e))))
+  (t/track
+    #(format "Evaluating metadata for namespace `%s'." ns-sym)
+    (binding [*ns* (the-ns ns-sym)]
+      (-> *ns* meta eval))))
+
+(defn- expand-namespace-metadata
+  "Adds a fifth element to each ns-spec, the evaluated namespace meta-data"
+  [ns-specs]
+  (map (fn [[context ns-sym :as ns-spec]]
+         (conj ns-spec (evaluate-namespace-metadata context ns-sym)))
+       ns-specs))
 
 (defn- construct-namespace-table-entry
   [sync-wrapper container-context ns-sym arg-resolvers middleware ns-metadata fn-name fn-var]

  "Invoked from [[namespace-handler]] to construct a Ring request handler for the provided
  options and namespace specifications.



  Returns a tuple of the constructed handler and the routing table (the flattened
  version of the namespace specifications)."
  {:added "0.1.20"}

                             (get options :context [])
                             (merge-arg-resolver-maps default-arg-resolvers (get options :arg-resolvers))
                             (get options :default-middleware default-namespace-middleware))
                           expand-namespace-metadata
                           (construct-routing-table
                             (if async?
                               (get options :sync-wrapper default-sync-wrapper)
