diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index 3b88e8f..aa3329d 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -1,29 +1,12 @@ defmodule Dispatcher do - use Plug.Router + use Matcher + define_accept_types [ + json: [ "application/json", "application/vnd.api+json" ] + ] - def start(_argv) do - port = 80 - IO.puts "Starting Plug with Cowboy on port #{port}" - Plug.Adapters.Cowboy.http __MODULE__, [], port: port - :timer.sleep(:infinity) - end - - plug Plug.Logger - plug :match - plug :dispatch + @json %{ accept: %{ json: true } } - # In order to forward the 'themes' resource to the - # resource service, use the following forward rule. - # - # docker-compose stop; docker-compose rm; docker-compose up - # after altering this file. - # - # match "/themes/*path" do - # Proxy.forward conn, path, "http://resource/themes/" - # end - - match _ do + match "/*_", %{ last_call: true } do send_resp( conn, 404, "Route not found. See config/dispatcher.ex" ) end - end diff --git a/config/resources/domain.json b/config/resources/domain.json new file mode 100644 index 0000000..d6682b6 --- /dev/null +++ b/config/resources/domain.json @@ -0,0 +1,7 @@ +{ + "version": "0.1", + "prefixes": { + }, + "resources": { + } +} diff --git a/config/resources/domain.lisp b/config/resources/domain.lisp index ac67a99..bfc6128 100644 --- a/config/resources/domain.lisp +++ b/config/resources/domain.lisp @@ -1,67 +1,4 @@ (in-package :mu-cl-resources) -;;;; -;; NOTE -;; docker-compose stop; docker-compose rm; docker-compose up -;; after altering this file. - -;; Describe your resources here - -;; The general structure could be described like this: -;; -;; (define-resource () -;; :class -;; :properties `(( ,) -;; ( ,>)) -;; :has-many `(( :via , -;; :as "") -;; ( :via , -;; :inverse t ; follow relation in other direction -;; :as "")) -;; :has-one `(( -;; :as "") -;; ( -;; :as "")) -;; :resource-base (s-url "") -;; :on-path "") - - -;; An example setup with a catalog, dataset, themes would be: -;; -;; (define-resource catalog () -;; :class (s-prefix "dcat:Catalog") -;; :properties `((:title :string ,(s-prefix "dct:title"))) -;; :has-many `((dataset :via ,(s-prefix "dcat:dataset") -;; :as "datasets")) -;; :resource-base (s-url "http://webcat.tmp.semte.ch/catalogs/") -;; :on-path "catalogs") - -;; (define-resource dataset () -;; :class (s-prefix "dcat:Dataset") -;; :properties `((:title :string ,(s-prefix "dct:title")) -;; (:description :string ,(s-prefix "dct:description"))) -;; :has-one `((catalog :via ,(s-prefix "dcat:dataset") -;; :inverse t -;; :as "catalog")) -;; :has-many `((theme :via ,(s-prefix "dcat:theme") -;; :as "themes")) -;; :resource-base (s-url "http://webcat.tmp.tenforce.com/datasets/") -;; :on-path "datasets") - -;; (define-resource distribution () -;; :class (s-prefix "dcat:Distribution") -;; :properties `((:title :string ,(s-prefix "dct:title")) -;; (:access-url :url ,(s-prefix "dcat:accessURL"))) -;; :resource-base (s-url "http://webcat.tmp.tenforce.com/distributions/") -;; :on-path "distributions") - -;; (define-resource theme () -;; :class (s-prefix "tfdcat:Theme") -;; :properties `((:pref-label :string ,(s-prefix "skos:prefLabel"))) -;; :has-many `((dataset :via ,(s-prefix "dcat:theme") -;; :inverse t -;; :as "datasets")) -;; :resource-base (s-url "http://webcat.tmp.tenforce.com/themes/") -;; :on-path "themes") - -;; +;; reading in the domain.json +(read-domain-file "domain.json") diff --git a/docker-compose.yml b/docker-compose.yml index 0e167dc..64202f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,13 +2,13 @@ version: '3.4' services: identifier: - image: semtech/mu-identifier:1.8.1 + image: semtech/mu-identifier:1.9.0 links: - dispatcher:dispatcher ports: - "80:80" dispatcher: - image: semtech/mu-dispatcher:1.1.2 + image: semtech/mu-dispatcher:2.0.0 links: - resource:resource volumes: