winget install --id=SpikeHD.swerve -e
Speedy, no-fuss serving of directories on a localhost webserver.
Primary Purpose
Swerve is a command-line interface (CLI) webserver designed to provide a speedy and hassle-free solution for serving directories on a localhost web server. It enables users to quickly test static files and directories with ease.
Key Features
Audience & Benefit
Ideal for developers and testers who need a fast and reliable way to serve static files or directories locally. Swerve provides a no-fuss solution that allows users to focus on their work without complicated setup or configuration. It can be installed via winget, ensuring easy deployment across supported platforms.
Speedy, no-fuss local webserver for testing/serving static files or directories.
winget install SpikeHD.swerve
> [!NOTE]
> Maintaining swerve
somewhere else? Feel free to add it here!
You can obtain binaries through releases, artifacts, or by building from source!
# Run the install script
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/SpikeHD/swerve/refs/heads/main/install.ps1" -OutFile "$env:TEMP\install.ps1"; PowerShell -ExecutionPolicy Bypass -File "$env:TEMP\install.ps1"
# You can uninstall by deleting C:\Program Files\Swerve
del C:\Program Files\Swerve
# Run the install script
curl -fsSL https://raw.githubusercontent.com/SpikeHD/swerve/refs/heads/main/install.sh | sudo bash
# You can uninstall by removing the binary from /usr/local/bin
rm /usr/local/bin/swerve
# Run the install script
curl -fsSL https://raw.githubusercontent.com/SpikeHD/swerve/refs/heads/main/install.sh | sudo bash
# You can uninstall by removing the binary from /usr/local/bin
rm /usr/local/bin/swerve
# Show help
swerve -h
# Serve the current directory
swerve
# Serve a specific directory
swerve path/to/directory
# Specify port
swerve -p 8080
# Enable hot reloading. This creates a websocket on port 8087.
swerve -H 8087
# Set basic auth credentials
swerve --basic-auth username:password
# Include files using a glob pattern
swerve -i *.html -i *.css -i *.js
# Exclude files using a glob pattern
swerve -e *.txt -e *.md
# Expose to the internet
swerve -p 8080 --bind 0.0.0.0
FROM ubuntu:latest
RUN echo "<h1>Hello World</h1>" > ./index.html
RUN apt update && apt install -y curl
RUN curl -fsSL https://raw.githubusercontent.com/SpikeHD/swerve/refs/heads/main/install.sh | bash
EXPOSE 8080
CMD ["swerve", "--port", "8080", "--bind", "0.0.0.0", "-r"]
You can access this by running the following:
docker build . --tag swerve-test
docker run -p 8080:8080 swerve-test
git clone https://github.com/SpikeHD/swerve.git
cd
into the repositorycd swerve
cargo build --release
The binary will be in target/release/
.
Issues, PRs, etc. are all welcome!