api preparations

integration-tests
Josha von Gizycki 6 years ago
parent d8b9cfa533
commit 0b8414b1ee

@ -14,6 +14,7 @@
ring/ring-codec
commons-io
commons-codec]]
[ring/ring-json "0.4.0"]
[hiccup "1.0.5"]
[joshavg/formulare "0.4.0-SNAPSHOT"]

@ -1,4 +1,4 @@
module Main exposing (Msg(..), main, update, view)
module Explore exposing (Msg(..), main, update, view)
import Browser
import Html exposing (Html, button, div, text)

@ -6,6 +6,7 @@
:refer [wrap-defaults site-defaults]]
[ring.util.response :as rur]
[ring.middleware.session.cookie :as session-cookie]
[ring.middleware.json :as ring-json]
[wanijo.home.routes :as home-routes]
[wanijo.schema
[routes :as schema-routes]
@ -46,6 +47,7 @@
(-> app-routes
devmode/wrap-devmode
schema-middleware/wrap-user-schemas
ring-json/wrap-json-response
(wrap-defaults
(assoc-in site-defaults
[:session :store]

@ -5,6 +5,7 @@
[wanijo.framework.routing :refer [register! path]]
[wanijo.framework.view :as view]
[wanijo.instance.domain :as domain-instance]
[wanijo.schema.domain :as domain-schema]
[wanijo.visualisation
[domain :as vis-domain]
[viz :as viz]
@ -17,10 +18,17 @@
[[:h1 "All Instances"]
(viz/all-instances (vis-domain/all-instance-connections!))]))
(defn all-schemas [req]
{:content-type "text/json"
:body (domain-schema/accessible-schemas! (-> req :session :uuid))})
(defroutes routes
(GET (register! :vis-index "/visualisation/index")
[:as req]
(vis-view/index req))
(GET (register! :vis-all-instances "/visualisation/all-instances")
[:as req]
(all-instances req)))
(all-instances req))
(GET (register! :vis-all-schemas "/api/visualisation/schemas")
[:as req]
(all-schemas req)))

Loading…
Cancel
Save