Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adam-fowler/swift-web

Web server serving local files
https://github.com/adam-fowler/swift-web

static-site-server swift webserver

Last synced: about 1 month ago
JSON representation

Web server serving local files

Awesome Lists containing this project

README

        

# swift-web

A web server serving local static files.

## Installation

### Using Mint

The easiest way to install swift-web is via [mint](https://github.com/yonaskolb/Mint).

```sh
mint install adam-fowler/swift-web
```

### Using Swift Package Manager

```sh
git clone https://github.com/adam-fowler/swift-web
swift build -c release
```
And then copy `.build/release/swift-web` to a folder in your $PATH

## Running

To serve files from the current folder run

```sh
swift web
```

This will run a web server bound to port 8001. Type `localhost:8001/` into your web browser to view a file.

To serve files from a particular folder run

```sh
swift web
```

You can also change the port the server uses with the `--port` option.

```sh
swift web --port 8080
```