dotnet tool install --global simpleserver-tool --version 0.3.0
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local simpleserver-tool --version 0.3.0
nuke :add-package simpleserver-tool --version 0.3.0
A simple server command line tool to run a static backend. Written in C#, cross platform.
It is cross platform, has around 30MB, and does not require .NET ou .NET Framework to run.
Download the version to your OS (see bellow) and run it like this:
simpleserver [<path>] [options]
If you run it without arguments it will serve the current running directory (pwd/cwd), bound
to all network interfaces (
0.0.0.0) on port
8080 and without logging to stdout. These are
all configurable and there are many other options.
||switch||Use a default index file when a file is not found.|
||Network interface (IP or hostname) to bind the server to.|
||Port to run the server at.|
||Default index file name.|
||switch||Show verbose output.|
||switch||Use simple paths. Allows to serve 'file.html' as '/file'.|
||switch||Log http output to stdout.|
||switch||Enable directory browsing.|
You can see this options in the command line by typing
For example, to run an SPA, you would want to serve every static file and serve
index.html for every requested route
that was not matched to a file. Like this:
To change the file, you'd also supply another option:
simpleserver -i --index-name default.html
You can't run directory browsing and index file at the same time. If you try, directory browsing will be disabled.
You can't run simple paths and directory browsing at the same time. If you try, simple paths will be disabled.
Running the framework dependent .dll
The framework dependent simpleserver.dll can be run where you already have the .NET Runtime installed. You'll need the .NET 6 runtime, and run it like this:
dotnet simpleserver.dll [<path>] [options]
You will need all the files that are in the .tgz, decompress it to a directory and run it from there.
Download an artifact from the latest release and add it to your path.
There are artifacts for Windows and Linux (x86, ARM and Musl). The Linux ones are
are dynamic binaries, they can't run on distroless containers (
simpleserver-linux-arm- Linux ARM
simpleserver-linux-musl-x64- Linux x64 Musl (Alpine etc)
simpleserver-linux-x64- Linux ARM
simpleserver.exe- Windows x64
simpleserver.tgz- Cross platform, framework dependent
.pdb files are symbol files and are only needed for debugging, not running the application.
As a dotnet cli tool
This tool can be installed as a dotnet global tool, if you have the .NET Sdk installed.
It is hosted on nuget.org as
dotnet tool install --global simpleserver-tool
This is written with
dotnet-suggest. You'll need the .NET Sdk to enable completions. The detailed steps
are outlined at the
It works everywhere the .NET Sdk works. The supported shells are detailed on the above document and include Bash, Zsh and PowerShell.
Questions, comments, bug reports, and pull requests are all welcome. Submit them at the project on GitHub.
Bug reports that include steps-to-reproduce (including code) are the best. Even better, make them in the form of pull requests.
Licensed under the MIT License.
|Product||Versions Compatible and additional computed target framework versions.|
|.NET||net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed.|
This package has no dependencies.