Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/adam-fowler/swift-web
- Owner: adam-fowler
- License: apache-2.0
- Created: 2021-12-02T12:33:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T18:03:32.000Z (10 months ago)
- Last Synced: 2024-09-16T00:07:37.667Z (2 months ago)
- Topics: static-site-server, swift, webserver
- Language: Swift
- Homepage:
- Size: 10.7 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```