#1 2014-07-19 03:10:24

budi2k6
Member
Registered: 2014-06-04
Posts: 4

httpapiserver

how to include  tsqlrest in thttpapiserver, so in 1 server can handle both http server static/dynamic file and restserver ?

Offline

#2 2014-07-19 08:09:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,232
Website

Re: httpapiserver

The easiest is IMHO to define a method-based service, then let the method return the file using Ctxt.ReturnFile().
This will also set the MIME type from the filename as expected, and handle HTML_NOTMODIFIED = 304 process, if needed.

I've also added Project04ServerStatic.dpr sample, able to serve some static content by overriding TSQLHttpServer.Request() method.
This is more complicated, but also a possible solution.

Offline

#3 2014-07-20 23:43:40

budi2k6
Member
Registered: 2014-06-04
Posts: 4

Re: httpapiserver

how to call project4static - restdb  in browser?

localhost:8080/root/samplerecord/
or
localhost:8080/static/samplerecord/

result not found ?

Offline

Board footer

Powered by FluxBB