add readme

This commit is contained in:
SadlyNotSappho 2023-05-05 16:57:53 -07:00
parent 8db4706786
commit 865ee8487f
1 changed files with 29 additions and 0 deletions

29
README.md Normal file
View File

@ -0,0 +1,29 @@
# dynamic-webserver
Simple 69-line program written in Rust that dynamically sets up a website. Basically everything it does is configurable - which isn't much, it just looks at a directory and sets up website subdirs based on the folders in the directory.
```
/srv/website
root
about
blog
/srv/website/root
index.html
/srv/website/about
index.html
/srv/website/blog
index.html
script.js
```
With this setup of folders, and the below ENV variables, it'll set up a website with the following subdirs. `localhost:8080` (showing you `/srv/website/root/index.html`), `localhost:8080/about` (showing you `/srv/website/about/index.html`), and `localhost:8080/blog` (showing you, you guessed it, `/srv/website/blog/index.html`)
```env
DIRS_LOC=/srv/website
INDEX_PATH=/
ROOT_NAME=root
IP_ADDR=127.0.0.1:8080
```