Resolve folders as index.html in folder
A web server serving local static files.
The easiest way to install swift-web is via mint.
mint install adam-fowler/swift-web
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
.build/release/swift-web
To serve files from the current folder run
swift web
This will run a web server bound to port 8001. Type localhost:8001/<filename> into your web browser to view a file.
localhost:8001/<filename>
To serve files from a particular folder run
swift web <folder>
You can also change the port the server uses with the --port option.
--port
swift web <folder> --port 8080
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
swift-web
A web server serving local static files.
Installation
Using Mint
The easiest way to install swift-web is via mint.
Using Swift Package Manager
And then copy
.build/release/swift-web
to a folder in your $PATHRunning
To serve files from the current folder run
This will run a web server bound to port 8001. Type
localhost:8001/<filename>
into your web browser to view a file.To serve files from a particular folder run
You can also change the port the server uses with the
--port
option.