This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-21
Channels
- # aleph (5)
- # aws (3)
- # bangalore-clj (1)
- # beginners (8)
- # boot (198)
- # cider (4)
- # cljsjs (5)
- # cljsrn (2)
- # clojure (14)
- # clojure-argentina (1)
- # clojure-dusseldorf (8)
- # clojure-greece (29)
- # clojure-italy (10)
- # clojure-japan (1)
- # clojure-poland (4)
- # clojure-russia (8)
- # clojure-spec (51)
- # clojure-uk (8)
- # clojurescript (97)
- # cursive (4)
- # datomic (6)
- # emacs (2)
- # events (2)
- # figwheel (3)
- # hoplon (32)
- # lein-figwheel (5)
- # leiningen (1)
- # luminus (2)
- # off-topic (29)
- # om (109)
- # other-languages (38)
- # proton (3)
- # re-frame (3)
- # ring (1)
- # slack-help (10)
- # testing (1)
- # uncomplicate (1)
- # untangled (21)
- # vim (10)
- # yada (11)
good afternoon!
I'm having some trouble with serving files using new-classpath-resource
and the index-files
option
I'm wondering if my setup is messed up somehow
(def routes
(vhosts-model
[[(str scheme "://" host)]
["/" {"dump" dump/handle-dump
"" (yada/yada (new-classpath-resource "homepage" {:index-files ["index.html"]}))
"dashboard" (yada/resource
{:id :dashboard
:produces {:media-type "text/html"
:language "en"}
:response (fn [ctx]
(dashboard-page))})
"endpoints" (yada/resource
{:id :endpoints
:produces {:media-type "application/json"}
:methods {:post
{:response
(fn [ctx]
(create-endpoint-request ctx))}}})
["endpoint/" :id]
{"" (yada/resource
{:id :endpoint
:produces {:media-type "application/json"}
:methods {:post
{:consumes "multipart/form-data"
:parameters {:form {:file String}}
:response upload-request}}})
["/upload/" :upload-id] (yada/resource
{:id :endpoint-upload
:response nil})}}]]))
There's my routes definition
if I GET to localhost/index.html
I get the page
but if I GET to localhost/ I get a 405
Ok, I figured it out by moving the / around
now, another question: how do I name the homepage resource if it's in a new-classpath-resource
?
I'd like to give it an id so I can generate it