Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aosasona committed Feb 22, 2024
1 parent a8d1aab commit 3d8b238
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ FROM node:18-alpine AS build

WORKDIR /app

# Install pnpm package manager and install dependencies
COPY package.json pnpm-lock.yaml .

# Install pnpm package manager and install dependencies
RUN npm install -g pnpm

RUN pnpm install
Expand Down Expand Up @@ -106,23 +106,23 @@ chimney run -c path/to/project/chimney.toml # the config filename is optional, i
> [!WARNING]
> HTTPS functionality has NOT been implemented yet, so using this standalone in production is kind of not feasible... unless you have some sort of central proxy and a bunch of containers running Chimney that you simply proxy requests to (you can probably tell what my usecase is...)
| **Field** | **type** | **Description** | **Default** |
| :---------------------- | :-------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| `host` | `string` | The IP address to bind to | `0.0.0.0` |
| `port` | `integer` | The (TCP) port to run the HTTP server on | `80` |
| `domain_names` | `array` | The domain names that the server should respond to, this has also not been implemented yet and does nothing yet | `[]` |
| `enable_logging` | `boolean` | Enable/disable request logging (what gets logged is currently limited and not quite customisable) | `true` |
| `root_dir` | `string` | This is where your static files and assets are located, for example `/var/www/html`. This is relative to where the config is located if it is not an absolute path, for example, if your config is located at `/Users/name/personal/chimney.toml` and the `root_dir` is set to `"public"`, this will be resolved to `/Users/name/personal/public` | `"public"` |
| `fallback_document` | `string` | The file that should be served if the requested path is neither a file that exists nor a valid redirect/rewrite, leaving this blank is also allowed and will just send the status code with no body. A good usecase would be setting this to `index.html` if you are serving an SPA, or `404.html` if you have an Astro site for example | `"index.html"` |
| `https.enable` | `boolean` | `unimplemented` | `false` |
| `https.auto_redirect` | `boolean` | `unimplemented` | `false` |
| `https.port` | `integer` | `unimplemented` | `443` |
| `https.use_self_signed` | `boolean` | `unimplemented` | `false` |
| `https.cert_file` | `string` | `unimplemented` | _`nil`_ |
| `https.key_file` | `string` | `unimplemented` | _`nil`_ |
| `rewrites` | `map` | A rewrite generally maintains the same URL but serves something different, the file doesn't even need to exist. A rewrite could in fact point to a redirect, the leading slash is required when defining a rewrite. For example, if you have a rewrite defined as `"/foo" = "page.html"`, even though `foo` is not a real file, when the server receives a request for `/foo`, it will read and serve the `page.html` file instead without the user knowing | |
| `headers` | `map` | Extra headers you want to append to every response the server sends out | _`nil`_ |
| `redirects` | `map` | A redirect maps a path to en external (or even internal) URL, unlike rewrites, a redirect does not read or serve a file, it simply takes the user away to the specified URL, and replays the request (useful for POSTs) if configured to. For example, `"/foo" = { to = "https://example.com", replay = false }` will take the user to `example.com` anytime they visit `yourwebsite.com/foo` but will NOT replay the request if it was a POST or similar. | _`nil`_ |
| **Field** | **type** | **Description** | **Default** |
| :---------------------- | :-------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| `host` | `string` | The IP address to bind to | `0.0.0.0` |
| `port` | `integer` | The (TCP) port to run the HTTP server on | `80` |
| `domain_names` | `array` | `unimplemented` The domain names that the server should respond to, this has also not been implemented yet and does nothing yet | `[]` |
| `enable_logging` | `boolean` | Enable/disable request logging (what gets logged is currently limited and not quite customisable) | `true` |
| `root_dir` | `string` | This is where your static files and assets are located, for example `/var/www/html`. This is relative to where the config is located if it is not an absolute path, for example, if your config is located at `/Users/name/personal/chimney.toml` and the `root_dir` is set to `"public"`, this will be resolved to `/Users/name/personal/public` | `"public"` |
| `fallback_document` | `string` | The file that should be served if the requested path is neither a file that exists nor a valid redirect/rewrite, leaving this blank is also allowed and will just send the status code with no body. A good usecase would be setting this to `index.html` if you are serving an SPA, or `404.html` if you have an Astro site for example | `"index.html"` |
| `https.enable` | `boolean` | `unimplemented` | `false` |
| `https.auto_redirect` | `boolean` | `unimplemented` | `false` |
| `https.port` | `integer` | `unimplemented` | `443` |
| `https.use_self_signed` | `boolean` | `unimplemented` | `false` |
| `https.cert_file` | `string` | `unimplemented` | _`nil`_ |
| `https.key_file` | `string` | `unimplemented` | _`nil`_ |
| `rewrites` | `table` | A rewrite generally maintains the same URL but serves something different, the file doesn't even need to exist. A rewrite could in fact point to a redirect, the leading slash is required when defining a rewrite. For example, if you have a rewrite defined as `"/foo" = "page.html"`, even though `foo` is not a real file, when the server receives a request for `/foo`, it will read and serve the `page.html` file instead without the user knowing | |
| `headers` | `table` | Extra headers you want to append to every response the server sends out | _`nil`_ |
| `redirects` | `table` | A redirect maps a path to an external URL (including the current site). Unlike rewrites, a redirect does not read or serve a file, it simply takes the user away to the specified URL, and replays the request (useful for POSTs) if configured to. For example, `"/foo" = { to = "https://example.com", replay = false }` will take the user to `example.com` anytime they visit `yourwebsite.com/foo` but will NOT replay the request if it was a POST or similar. | _`nil`_ |

You can find sample config files [here](https://github.com/aosasona/chimney/blob/master/examples/basic/chimney.toml) and [here](https://github.com/aosasona/chimney/blob/master/examples/trulyao/chimney.toml).

Expand Down

0 comments on commit 3d8b238

Please sign in to comment.