Git Product home page Git Product logo

Comments (3)

resttime avatar resttime commented on August 22, 2024 1

No problem @thiru. You caught me while I was submitting an issue so I thought I'd help! :)

Can't believe I forgot about pathnames though because the static middleware basically works by returning pathnames that match a regexp. My solution would be overkill for your use case and better for something like a shoutcast/icecast music streamer.

from ningle.

resttime avatar resttime commented on August 22, 2024

I'm not too sure but this might be the relevant documentation, look for the Delayed Response and Streaming Body topic under https://github.com/fukamachi/lack . I forgot the syntax but I do remember doing something in ningle with this.

At least I think that's one way by using that after setting the *RESPONSE* to content-type application/octet-stream.

(setf (lack.response:response-headers *response*)
        (append (lack.response:response-headers *response*)
                     (list :content-type "application/octect-stream")))

I'm not sure what you want is a good idea though for security reasons since I'm under the impression most web dev likes to keep what's "public" separate from the "private".

from ningle.

thiru avatar thiru commented on August 22, 2024

Thanks for the quick response @resttime, much appreciated!

I noticed the Lack readme says it's possible to return a pathname as the response body. This seems to work and I can point it at any arbitrary path in the file-system.

I know this sounds like a crazy thing to do but the nature of the app I'm building is to serve as a sort of web-based file browser.

from ningle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.