emikulic / darkhttpd

When you need a web server in a hurry.
https://unix4lyfe.org/darkhttpd/
ISC License
1.03k stars 83 forks source link

Adding initial run with mimetypes and index page #20

Open saidbakr opened 2 years ago

saidbakr commented 2 years ago

Initial run options after compile to get quick ride with the server. It includes index.html, mimetypes to be able to access a linked README.md and run.sh shell script to apply those initial run options.

solt87 commented 6 months ago

I wonder if hard-coding the custom 404 page's path without optionally giving a custom file path might cause some headaches. What if someone installs darkhttpd in ~/bin (or even in /usr/local/bin/)? Not being able to give a custom path for the custom error page means the custom error file must also go in ~/bin (or wherever darkhttpd is installed), which results in "littering" a bin directory with non-executable data.

Would it be reasonable to have an optional file path follow the --e404 option, in which case the given file would be used? If one uses darkhttpd for more than one projects, a hard-coded error page might not suffice in all cases.

Or, simpler yet, the custom 404 page file should be looked for in the "web root" directory that darkhttpd serves.