IXWebSocket icon indicating copy to clipboard operation
IXWebSocket copied to clipboard

Configurable "doc root" for IXHttpServer

Open fweiss opened this issue 1 year ago • 2 comments

Currently when using IXHttpServer, static files are served from ".". This means static files have to be put into the same directory the server runs in. I think it is better practice to have a separate directory, such as "www" for the static files.

I propose a change to IXHttpServer, so that the line std::string path("." + uri); can use a member variable instead of the ".". The simplest way is simply to add to the IXHttpServer class a new member variablestd::String docRoot;. It would have default initialization to ".". I think simply public access would do, but need to review any security/extensibility concerns.

I'll open a PR after a short review by a committer.

fweiss avatar Mar 02 '23 19:03 fweiss