Giter Club home page Giter Club logo

Comments (11)

michaelvanham avatar michaelvanham commented on June 20, 2024

You can see some discussion about ways to handle static files in issue #20.

Currently I am using:

procedure tstatic.get;
var
  f,b:string;
  contenttype:string;
begin
  f := rightstr(GetRequest.URI,pred(length(GetRequest.URI)));
  if FileExistsUTF8(f) then begin
    with TFileStream.Create(f,fmOpenRead) do
      try
        setlength(b,size);
        read(b[1],size);
        self.write(b);
      finally
        free;
      end;
  end
  else
    writeln('not found: ' + f); //todo raise 404 instead
end;

initialization
  tstatic.register('*');  

from brookframework.

leledumbo avatar leledumbo commented on June 20, 2024

Use static action broker (has it been commited, @silvio?)

Sent from my Android phone with mail.com Mail. Please excuse my brevity.

tcaduto [email protected] wrote:

Hi,
When using the embedded http broker how can I set a public html directory for Javascript libraries, images etc


Reply to this email directly or view it on GitHub.

from brookframework.

silvioprog avatar silvioprog commented on June 20, 2024

Hm... I was waiting for you to send a broker or a new unit implementing this feature (#20 (comment)). :)

Feel free to send it (in working branche). ;)

from brookframework.

leledumbo avatar leledumbo commented on June 20, 2024

We're waiting each other then :p #deadlock

I'll commit tonight with an example

Sent from my Android phone with mail.com Mail. Please excuse my brevity.

Silvio Clecio [email protected] wrote:

Hm... I was waiting for you to send a broker or a new unit implementing this feature (#20). :)

Feel free to send it (in working branche). ;)


Reply to this email directly or view it on GitHub.

from brookframework.

tcaduto avatar tcaduto commented on June 20, 2024

I would only need to use that when running in the embedded http server correct?

from brookframework.

leledumbo avatar leledumbo commented on June 20, 2024

Yes, but for portability I suggest using it anyway. So you can switch between CGI, FCGI and embedded server easily.

Sent from my Android phone with mail.com Mail. Please excuse my brevity.

tcaduto [email protected] wrote:

I would only need to use that when running in the embedded http server correct?


Reply to this email directly or view it on GitHub.

from brookframework.

tcaduto avatar tcaduto commented on June 20, 2024

Is the static broker in the git master yet?

from brookframework.

leledumbo avatar leledumbo commented on June 20, 2024

Forgive me, I forgot. Please wait a minute.

EDIT: Done in working branch, no example yet (take it from previous issue).

Sent from my Android phone with mail.com Mail. Please excuse my brevity.

tcaduto [email protected] wrote:

Is the static broker in the git master yet?


Reply to this email directly or view it on GitHub.

from brookframework.

silvioprog avatar silvioprog commented on June 20, 2024

@leledumbo , Can you send a demo using this feature? If yes, I'll refactore the code and add it in RT package?

from brookframework.

silvioprog avatar silvioprog commented on June 20, 2024

Related to: #20

from brookframework.

silvioprog avatar silvioprog commented on June 20, 2024

Done. Please follow issue #20

from brookframework.

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.