Fork me on GitHub
#duct
<
2019-05-07
>
javi13:05:35

HI guys, just started learning duct ( although i use integrant in the front end for a framework i am building ). I have used luminus for a backend so familiar with the main ring / compojure ecosystem. So, a possibly stupid question, but i have found no examples to orient myself ... how would i implement cors when using :duct.module.web/api or :duct.router/cascading ? any direction would be appreciated. cheers

jahson21:05:26

@clojurians827 I think it is happening because :duct.migrator/ragtime and [:duct.migrator.ragtime/sql :todo.migration/create-entries] should be in the base profile

jahson21:05:03

{:duct.profile/base
 {:duct.core/project-ns todo

  :duct.router/ataraxy
  {:routes   {[:get "/"] [:todo.handler/index]}
   :handlers {:todo.handler/index #ig/ref :todo.handler/index}}
 
 [:duct.handler.static/ok :todo.handler/index]
 {:body {:entries "/entries"}}
 
 :duct.migrator/ragtime
 {:migrations [#ig/ref :todo.migration/create-entries]}

 [:duct.migrator.ragtime/sql :todo.migration/create-entries]
  {:up ["CREATE TABLE entries (id INTEGER PRIMARY KEY, content TEXT)"]
   :down ["DROP TABLE entries"]}}

 :duct.profile/dev   #duct/include "dev"
 :duct.profile/local #duct/include "local"
 :duct.profile/prod  {}

 :duct.module/logging {}
 :duct.module.web/api {}
 :duct.module/sql {}}