Skip to content

Commit

Permalink
Optional port for documentation server #1198
Browse files Browse the repository at this point in the history
  • Loading branch information
lgersen committed Oct 29, 2023
1 parent d38d5a0 commit 7f8fe0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Clone the project (for example, in `C:/Web`):

```git clone https://github.com/leongersen/noUiSlider nouislider```

Note that the documentation assumes a clone in a lowercase "nouislider" directory.

You can now run the following shorthand to start the server:

```
Expand All @@ -14,6 +16,12 @@ npm run docs

You can now access the documentation at `http://localhost:8080/nouislider/`.

To run on another port, set a `PORT` environment variable:

```
PORT=8086 npm run docs
```

Alternatively, in your root (e.g. `C:/Web`), start the server:

```php -S localhost:8080 nouislider/documentation/_run/router.php```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"prepublishOnly": "npm run build",
"format": "prettier src/nouislider.ts --write --config .prettierrc",
"lint": "eslint src/nouislider.ts",
"docs": "cd ../ && php -S localhost:8080 nouislider/documentation/_run/router.php"
"docs": "cd ../ && php -S localhost:${PORT:-8080} nouislider/documentation/_run/router.php"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.10",
Expand Down

0 comments on commit 7f8fe0c

Please sign in to comment.