boot-livereload icon indicating copy to clipboard operation
boot-livereload copied to clipboard

Add resource middleware

Open arichiardi opened this issue 6 years ago • 5 comments

This patch uses the ring middleware to correctly serve resources other than livereload stuff from the classpath.

arichiardi avatar Nov 28 '17 07:11 arichiardi

Hmh, I have used this together with https://github.com/metosin/boot-alt-http

Serving other resources would require at least option to set the resource prefix. And even then it would only serve files from classpath, not filesystem. I'm not sure if I want to add this feature here.

Deraen avatar Nov 28 '17 12:11 Deraen

Ok so maybe I have misunderstood how to use this, I thought I was a replacement for boot-http but it is not...I am not supposed to connect to localhost:35729 for the entire app right? Only for those the livereload.js files.

In that case then yeah...I saw http-kit while exploring the code and thought this was a replacement..

arichiardi avatar Nov 28 '17 15:11 arichiardi

Yeah, not replacement. I guess the readme is a bit confusing.

Deraen avatar Nov 28 '17 15:11 Deraen

Btw with this patch everything works because I am passing asset-path and using it in the handler. So serving from the files is already good, but feel free to close it if you don't see a good fit here.

arichiardi avatar Nov 28 '17 15:11 arichiardi

Now understand while the case was throwing also, it is not meant to serve anything else :smile:

arichiardi avatar Nov 28 '17 15:11 arichiardi