Clojure live browser reload on Linux

老子叫甜甜 提交于 2019-12-04 07:06:43

OK, this can be done very easily, but with Grunt and https://github.com/gruntjs/grunt-contrib-watch (which has built in LiveReload support), Grunt will work with any language.

I was poking around the c2 library and discovered the author created a liverelaod server in Clojure.

https://github.com/lynaghk/c2/tree/master/vrepl

He also has a screencast on his website. http://keminglabs.com/c2/

Grunt will probably work for you, but since you asked about a Clojure implementation I thought I would mention it.

Imho the best and idiomatic way to go in your case could be to migrate from Ring Jetty adapter to http-kit which provides hot code reload out of the box. It also supports Websockets and it has a noticeable performance

Of course it's compatible with Ring & Compojure: HTTP Kit is a minimalist, efficient, Ring-compatible HTTP client/server for Clojure. It uses a event-driven architecture to support highly concurrent a/synchronous web applications. Feature a unified API for WebSocket and HTTP long polling/streaming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!