Fork me on GitHub
#re-frame
<
2016-01-08
>
virmundi01:01:03

Hello. I'm trying to use compojure and re-frame together. I've used the template. I can't seem to get compojure handlers to work with the figwheel configuration.

virmundi01:01:11

what's the trick?

virmundi01:01:41

the figwheel configuration passes through to static index.html.

kamn03:01:55

@mikethompson: I have a re-frame docs question. I noticed you often don't capitalize the start of bullet points. Are you opposed to following [this](http://english.stackexchange.com/a/55049) recommendation?

kamn03:01:47

@virmundi: Are you trying to have multiple htmls pages instead of a single page application?

virmundi03:01:13

nope. I want a rest API for compojure

virmundi03:01:28

so spa in the front, party in the back.

virmundi03:01:57

I got the feeling that I could update the project's handler ns. It seems that the static file is not servered by compojure, but rather the figwheel static file server.

mikethompson03:01:32

@kamn no opinion (or knowledge) on/of style here. There's just whatever the fingers type.

kamn03:01:27

@virmundi: What template are you using?

virmundi03:01:28

None right now. I'm at the very start. I want to have localhost:3449/rest/api/is/here to get data. When I such a URL, I get a Page Not Found notice even though that URL points to a compojure handler returning static content.

virmundi04:01:58

It's really odd. if I reset the whole project back to basically the template, I can get the compojure features to work. If I try to add ring wrappings like json-response, nothing works. If I remove that change, nothing works even after a full shutdown of figwheel, cleaning and a restart

kamn04:01:12

are you running just "lein figwheel"?

kamn04:01:26

assuming you are using lein

kamn04:01:56

because you can try "lein run" and "lein figwheel"

virmundi04:01:07

lein do clean, figwheel

kamn04:01:23

then connect on the normal server port and figwheel will still work

virmundi04:01:14

but won't I have to have two servers running on different ports?

kamn04:01:58

but figwheel's ring server is just sort of a nice to have that it throws in

kamn04:01:52

I am suggesting this because I think figwheel recommend to NOT use it's ring server

kamn04:01:11

So I recommend trying localhost:3000/rest/api/is/here and if that fails then it is something with the server software, if it works then it is just figwheel having an issue

virmundi04:01:29

I didn't know that last bit. that does make developing a bit more complex with clojurescript/re-frame

kamn04:01:41

It is really not too bad at all

kamn04:01:05

I mean I usually have both "lein run" and "lein figwheel" running

virmundi04:01:32

I have to get into the profiles and change ports that's all.

virmundi04:01:50

when you do a production build, are the ports unified?

kamn04:01:54

I usually just use figwheel on dev so I don't know. There is a figwheel channel though

virmundi04:01:33

that's fair. It sounds like running things without figwheel should just clip on

dvcrn10:01:10

Hey re-frame guys! I just found re-frame and I am really really impressed!

dvcrn10:01:20

I have a little question how to do things "right"

dvcrn10:01:34

So I have a handler that loads some stuff and then dispatches to success / error callbacks like in the readme

dvcrn10:01:18

for parameters, should I 1. pass the server parameters to the handler? 2. Or should I make a separate dispatch that updates the search parameters inside the db, which then triggers handler which then reads that data out of the db and does it's ajax stuff

dvcrn10:01:35

I read both approaches in online resources and not sure which one is right

mccraigmccraig10:01:30

@dvcrn: either is good - if you need to show the params in a view then you will want them in the db, otherwise whatever is most convenient

dvcrn10:01:52

ok - fair enough!