#web-server #server #https #http #web #serve-static

app devserver

A simple server for locally hosting a folder

5 releases

0.4.2 Mar 25, 2023
0.4.1 Jan 2, 2022
0.4.0 May 7, 2021
0.1.7 Sep 14, 2020
0.1.0 Dec 30, 2019

#212 in HTTP server

Zlib license

52KB
899 lines

devserver Crates.io

An extremely tiny tool to serve a static folder locally.

This tool is only for local development and makes no effort to be secure for other purposes.

DO NOT USE DEVSERVER IN PRODUCTION

devserver should only be used for locally hosting files on a trusted network.

devserver does not properly handle the attacks robust servers must withstand on an open network.

Installation

cargo install devserver

Usage

Open a command line and navigate to the directory you'd like to host then run:

devserver

Visit http://localhost:8080 or https://localhost:8080 to see your hosted content.

Options

--reload Automatically refresh pages when a file in the hosted folder changes.

--address Pass an address like "127.0.0.1:8080" or "localhost:8000" to change the address the server will host on.

--path Changes the directory to be hosted.

--header Pass a header like "Access-Control-Allow-Origin='*'". Use multiple --header flags for multiple headers.

--help Explains available options.

Dependencies

~1.1–9MB
~71K SLoC