Skip to content

Commit

Permalink
Update HOSTING.md (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud committed May 14, 2024
1 parent 0a4b859 commit 19735e2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions HOSTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

## Clone the Source Code

```baseh
```bash
git clone https://github.com/esm-dev/esm.sh
cd esm.sh
```

## Configration
## Configuration

To configure the server, create a `config.json` file then pass it to the server bootstrap command. For example:

Expand All @@ -29,15 +29,15 @@ To configure the server, create a `config.json` file then pass it to the server
You can find all the server options in [config.exmaple.jsonc](./config.example.jsonc). (**Note**: the
`config.example.jsonc` is not a valid JSON file, it's a JSONC file.)

## Run the Sever Locally
## Run the Server Locally

You will need [Go](https://golang.org/dl) 1.18+ to compile the server.

```bash
go run main.go --config=config.json --dev
```

Then you can import `React` from http://localhost:8080/react
Then you can import `React` from <http://localhost:8080/react>.

## Deploy the Server to a Single Machine

Expand All @@ -58,7 +58,7 @@ Recommended host machine requirements:

[![Docker Image](https://img.shields.io/github/v/tag/esm-dev/esm.sh?label=Docker&display_name=tag&sort=semver&style=flat&colorA=232323&colorB=232323&logo=docker&logoColor=eeeeee)](https://github.com/esm-dev/esm.sh/pkgs/container/esm.sh)

esm.sh provides a docker image for deployment. You can pull the container image from https://ghcr.io/esm-dev/esm.sh.
esm.sh provides a Docker image for deployment. You can pull the container image from <https://ghcr.io/esm-dev/esm.sh>.

```bash
docker pull ghcr.io/esm-dev/esm.sh # latest version
Expand Down Expand Up @@ -86,7 +86,7 @@ Available environment variables:
- `AUTH_SECRET`: The server auth secret, default is no authrization check.
- `DISABLE_COMPRESSION`: Disable compression, default is false.

You can also create your own Dockerfile with `ghcr.io/esm-dev/esm.sh`:
You can also create your own Dockerfile based on `ghcr.io/esm-dev/esm.sh`:

```dockerfile
FROM ghcr.io/esm-dev/esm.sh:v135
Expand All @@ -99,4 +99,4 @@ CMD ["esmd", "--config", "/etc/esmd/config.json"]
We use [Cloudflare Workers](https://workers.cloudflare.com/) as the front layer to handle and cache esm.sh requests at
edge(earth). And we open sourced the code, you can use it to build your own esm.sh CDN that's running globally.

More details check [esm-worker](./packages/esm-worker/README.md).
For more details check [esm-worker](./packages/esm-worker/README.md).

0 comments on commit 19735e2

Please sign in to comment.