figwheel-main

figwheel-main http://figwheel.org
athomasoriginal 2020-06-03T21:15:54.148500Z

Question about using a https://figwheel.org/docs/your_own_server.html with figwheel. I have a monorepo structure like this:

├── app
│   ├── deps.edn
│   ├── dev.cljs.edn
│   ├── resources
│   ├── src
│   └── target
├── app-server
│   ├── deps.edn
│   ├── resources
│   └── src
The app-server package is a simple backend server which will be used in production to server static files (html, css, js etc) in addition to some custom routes and the app package is the front end itself.

athomasoriginal 2020-06-03T21:16:23.149400Z

What is the recommended approach to serving the static files like the index.html from the custom server?

athomasoriginal 2020-06-03T21:19:43.151800Z

For more info, the app-server would run at localhost:3000 and then figwheel server could continue to run at localhost:9500

bhauman 2020-06-03T21:21:26.153200Z

yeah so you just need to add the ../app/target/ to your resource paths

bhauman 2020-06-03T21:21:57.153700Z

for your app server under development mode

bhauman 2020-06-03T21:22:03.153900Z

I mean your classpath

bhauman 2020-06-03T21:22:33.154500Z

and configure your server to serve static resources

bhauman 2020-06-03T21:23:03.155Z

If you are using ring then I believe site-defaults works??

athomasoriginal 2020-06-03T21:31:46.155700Z

Works. Thanks!

1👍