Fork me on GitHub
#figwheel-main
<
2020-10-07
>
ozzloy03:10:20

i'd like to run figwheel and use sente for web sockets in my own code. it seems like this might be possible, but i haven't been able to figure out how

ozzloy06:10:03

got figwheel working alongside my own server. i get the feeling there's a better way to do this. any pointers much appreciated: https://gitlab.com/ozzloy/figserv

Jan K11:10:40

https://gitlab.com/jan_k/doomlist This project uses devtime-only figwheel that starts via the scripting API (shares JVM with the app) and also runs it's own httpkit + sente.

ozzloy06:10:53

idk what i'm doing, so i would be more surprised to find out there isn't a better way to do this than to find out this is a pretty reasonable way to do this

Jan K11:10:00

I use figwheel and sente in my project without issues. You mean you want them to share one web server? Figwheel needs to run its own AFAIK

dominicm11:10:41

Figwheel was designed to be part of your server if you so choose, but it's very uncommon

Jan K11:10:18

I don't think you can set up figwheel to run in your server like httpkit, it needs to use its own builtin jetty server. See https://github.com/bhauman/figwheel-main/issues/214

Jan K11:10:59

But of course you can run your app in httpkit with sente and also use Figwheel reloading, the servers can coexist https://figwheel.org/docs/your_own_server.html

dominicm11:10:58

I'm pretty sure the handler exists in isolation in Figwheel-repl

dominicm11:10:40

There's comments in the source indicating that it was the intention, but web sockets and jetty required this to be a thing.

ozzloy23:10:47

@jkr.sw i want to use sente, which i think requires some http server. i was under the impression that figwheel had to be that http server in order for it to do all the reloading goodness.

ozzloy23:10:31

i'm also just not sure in general about all of this. web dev is all new to me. i'm new to things like http requests, middleware, routing, etc.

ozzloy23:10:46

at this point, i got http-kit up and running and got figwheel to open the page served by it. next thing i'll work on is getting emacs integration. right now i launch figwheel via command line, but i'd rather have cider do it and i think there's a way to get that to happen

ozzloy23:10:27

@jkr.sw @dominicm thanks for the help! it's nice to know that figwheel is supposed to be capable of this and i'm not doing something weird at a system level

ozzloy23:10:13

on this page https://figwheel.org/docs/your_own_server.html it says "You will need to run Figwheel as well as your application server.", but i misread it