Skip to content

Commit

Permalink
Merge pull request #8 from tschaub/docs
Browse files Browse the repository at this point in the history
Installation docs
  • Loading branch information
tschaub authored Sep 6, 2023
2 parents 5b7a8bc + bb32279 commit cf8adf9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
32 changes: 15 additions & 17 deletions license.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# License for serve
MIT License

The serve module is distributed under the MIT license. Find the full source
here: http://tschaub.mit-license.org/
Copyright (c) 2023 Tim Schaub

Copyright Tim Schaub.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 21 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# serve
# Serve

Serve files via HTTP.

Expand All @@ -16,21 +16,36 @@ Flags:
--explicit-index Only serve index.html files if URL path includes it.
```

The `serve <dir>` command can be used to browse files in a directory via HTTP. For example, `serve .` starts a server for browsing the files in the current working directory.
The `serve <dir>` command can be used to browse files in a directory via HTTP. For example, `serve .` starts a server for browsing the files in the current working directory. See below for more detail on the [usage](#usage).

## `--port`
## Installation

The `serve` program can be installed by downloading one of the archives from [the latest release](https://github.com/tschaub/serve/releases).

Extract the archive and place the `serve` executable somewhere on your path. See a list of available commands by running `serve` in your terminal.

Homebrew users can install the `serve` program with [`brew`](https://brew.sh/):

```shell
brew update
brew install tschaub/tap/serve
```

## Usage

### `--port`

By default, files are served on port 4000 (e.g. `http://localhost:4000`). To have the server listen on a different port, pass a different value to the `--port` argument (e.g. `serve --port 9000 .`).

## `--no-cors`
### `--no-cors`

By default, files are served with [CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). To turn off this behavior, use the `--no-cors` argument (e.g. `serve --no-cors .`).

## `--dot`
### `--dot`

By default, files and directories starting with a `.` will not be listed or served. To allow browsing `.`-prefixed files, use the `--dot` argument (e.g. `serve --dot .`).

## `--explicit-index`
### `--explicit-index`

By default, if a directory does not include an `index.html` file, a listing of files in the directory will be served. If a directory does include an `index.html` file, that file will be served instead of the directory listing.

Expand Down

0 comments on commit cf8adf9

Please sign in to comment.