This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-28
Channels
- # announcements (1)
- # beginners (183)
- # boot (2)
- # clara (4)
- # cljs-dev (20)
- # clojure (59)
- # clojure-dev (7)
- # clojure-nl (1)
- # clojure-serbia (1)
- # clojure-sg (1)
- # clojure-spec (4)
- # clojure-uk (15)
- # clojurescript (77)
- # clr (1)
- # data-science (9)
- # datomic (23)
- # docs (3)
- # duct (15)
- # emacs (8)
- # events (1)
- # fulcro (6)
- # instaparse (3)
- # juxt (1)
- # lumo (9)
- # off-topic (18)
- # perun (2)
- # portkey (13)
- # reagent (2)
- # reitit (11)
- # ring (10)
- # shadow-cljs (158)
- # tools-deps (34)
something like that works: :autocmd BufWritePost *.clj execute ":Eval (do (user/dev) (reset))"
Can anyone steer me towards adding an api middleware? I’ve defined the following in my project:
(ns slack-api.middleware.apigw
(:require [ring.middleware.apigw :as apigw]
[integrant.core :as ig]))
(defmethod ig/init-key :slack-api.middleware/apigw [_ options]
#(apigw/wrap-apigw-lambda-proxy % (or options {})))
And I’m trying to include it like so in config.edn
:
:duct.module.web/api
{:middleware [#ig/ref :slack-api.middleware/apigw]}
But I get the following error at the repl:
dev> (reset)
:reloading (slack-api.main)
clojure.lang.ExceptionInfo: Missing definitions for refs: :slack-api.middleware/apigw
I’m sure I’m missing something fundamental 😞 - but I’m having a hard time seeing what
@scaturr did you "call" the key with its arguments in config.edn?
something like :slack-api.middleware/apigw {}
Also, I believe that the :duct.core/handler
key should be used to set the middleware, @scaturr
Is that just a matter of convention? Or it will not work the other way? I thought I saw in the web module that the config to ::api
gets merged?
(haven’t actually deployed to api gateway via lambda yet so haven’t tested whether it works - or if I even can deploy to lambda)
I’m pretty sure it won’t work, @scaturr. The web module doesn’t pull in the :middleware
key from the options.