Configurable "doc root" for IXHttpServer
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.
Well, I've found a work around. Run the (IXWebsocket) server in the directory where the static files are located. However other web servers, such as nginx, apache2, express provide for setting a doc root.
That's a good suggestion. If you want to make a PR I'd be happy to consider it.