Skip to content

Commit

Permalink
Document webserver configuration via ROCKET_ environment variables
Browse files Browse the repository at this point in the history
Resolves #17
  • Loading branch information
spawnia committed Nov 7, 2024
1 parent d9b97e8 commit b76c2c4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ If you need guaranteed availability, [deploy it yourself](#deploy).

You can convert markdown by sending a `POST` request to `https://md-to-pdf.fly.dev`.

curl --data-urlencode 'markdown=# Heading 1' --output md-to-pdf.pdf https://md-to-pdf.fly.dev
```shell
curl --data-urlencode 'markdown=# Heading 1' --output md-to-pdf.pdf https://md-to-pdf.fly.dev
```

| Parameter | Required | Description |
|------------|----------|-------------------------------------------------------------------------------------------------------|
Expand All @@ -24,14 +26,27 @@ You can convert markdown by sending a `POST` request to `https://md-to-pdf.fly.d

Send data from files like this:

curl --data-urlencode "markdown=$(cat example.md)"
```shell
curl --data-urlencode "markdown=$(cat example.md)"
```

## Deploy

A prebuilt container image is available at [Docker Hub](https://hub.docker.com/r/spawnia/md-to-pdf).
The container starts up the web service and listens for HTTP on port 8000.

You can run it yourself like this:

docker run --publish=8000:8000 spawnia/md-to-pdf
```shell
docker run --publish=8000:8000 spawnia/md-to-pdf
```

You may configure the webserver through [Rocket environment variables](https://rocket.rs/guide/v0.5/configuration#environment-variables).
For example, you could allow larger payloads by increasing the limit for form data:

```dotenv
ROCKET_LIMITS={form="1MiB"}
```

## Built with

Expand Down
21 changes: 18 additions & 3 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ <h1 hidden="hidden">md-to-pdf</h1>

You can convert markdown by sending a `POST` request to `https://md-to-pdf.fly.dev`.

curl --data-urlencode 'markdown=# Heading 1' --output md-to-pdf.pdf https://md-to-pdf.fly.dev
```shell
curl --data-urlencode 'markdown=# Heading 1' --output md-to-pdf.pdf https://md-to-pdf.fly.dev
```

| Parameter | Required | Description |
|------------|----------|-------------------------------------------------------------------------------------------------------|
Expand All @@ -98,14 +100,27 @@ <h1 hidden="hidden">md-to-pdf</h1>

Send data from files like this:

curl --data-urlencode "markdown=$(cat example.md)"
```shell
curl --data-urlencode "markdown=$(cat example.md)"
```

## Deploy

A prebuilt container image is available at [Docker Hub](https://hub.docker.com/r/spawnia/md-to-pdf).
The container starts up the web service and listens for HTTP on port 8000.

You can run it yourself like this:

docker run --publish=8000:8000 spawnia/md-to-pdf
```shell
docker run --publish=8000:8000 spawnia/md-to-pdf
```

You may configure the webserver through [Rocket environment variables](https://rocket.rs/guide/v0.5/configuration#environment-variables).
For example, you could allow larger payloads by increasing the limit for form data:

```dotenv
ROCKET_LIMITS={form="1MiB"}
```

## Built with

Expand Down

0 comments on commit b76c2c4

Please sign in to comment.