This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-25
Channels
- # aws (2)
- # bangalore-clj (2)
- # beginners (90)
- # boot (89)
- # bristol-clojurians (1)
- # cider (23)
- # cljs-dev (48)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (118)
- # clojure-argentina (3)
- # clojure-austin (8)
- # clojure-czech (1)
- # clojure-dev (18)
- # clojure-ireland (1)
- # clojure-italy (4)
- # clojure-russia (6)
- # clojure-spec (75)
- # clojure-uk (224)
- # clojurescript (103)
- # core-async (28)
- # cursive (3)
- # datascript (7)
- # datomic (15)
- # dirac (30)
- # emacs (14)
- # events (3)
- # figwheel (1)
- # hispano (1)
- # hoplon (176)
- # lambdaisland (1)
- # lein-figwheel (6)
- # off-topic (21)
- # om (7)
- # onyx (2)
- # pedestal (6)
- # re-frame (4)
- # reagent (15)
- # spacemacs (67)
- # specter (13)
- # testing (9)
- # untangled (65)
- # vim (6)
- # yada (1)
Any pointers how to configure nginx to serve static index.html reagent app with router?
afaik, you just put the js output compiled from cljs to that webserver, and that's it
I have a virtua host on nginx that points http://app.mydomain.com to that index.html and when I click a link on reagent app that directs to http://app.mydomain.com/room it works great. But when I open new browser window and enter http://app.mydomain.com/room I get 404
ahhh, I think going there directly is the problem because it's looking for a file or folder named room
and where js is isn't really involved
@artur, you need to change you nginx configuration to handle all requests for /*
, e.g. /room
, with index.html
that's really an nginx question 🙂
Actually I had to do the following: location / { try_files $uri /index.html; } I know it is an nginx issue but I think this is quite related to reagent since docs mostly talk about running the server version of reagent.
what is the "server version of reagent"?
naming is hard 😄 suggestion on how to call a namespace that includes functions that accept the app-state
and return things? state.clj
is ugly
@richiardiandrea Agreed, naming is definitely hard 😆 What kind of stuff is it returning?
let's say I have resources in the state and I need to index them, I will a get-indexed-resources
function
I have a bunch of them and it is becoming unwieldy, in re-frame
I'd call it db.clj
probably
Ahh gotcha, yeah, i see why naming it is murky. I have a file called model.cljs with my app-state, and another file called cursors.cljs with my cursors, but i dont do any kind of processing there like indexing, so cant draw on experience to help. Hopefully someone else will chime in with a good name :)