You are not logged in.
now we have ORM, Rest Server, for web front, we also need a simple web server to server static file, search forum there are also some similar demand, is there any possibility to have a build in Web Server, for example, sub class of TSQLHttpServer, accessional to server a directory content, thanks!
Offline
See sample "09 - HttpApi web server" for a stand-alone Web Server at TSQLHttpServer level.
See also "22 - JavaScript HTTPApi web server" for something even more complete, including server-side JavaScript scripting!
You can mix ORM and web server on the same TSQLHttpServer instance, of course.
One possibility is to use a method-based service, which will return the content of a directory by using STATICFILE_CONTENT_TYPE in the response headers, and supplying the file name as body (encoded as UTF-8).
See both 09 and 22 samples about how this works.
Offline
thank you ab, I know the example, i think if it's a common demand, why always reinvent the wheel, if has a build in web server, then can enhanced it step by step, since there are some function is not easy to implement.
Offline