https://github.com/morris/s4d
Minimal web development server with live reload
https://github.com/morris/s4d
cli http local-development web
Last synced: 4 months ago
JSON representation
Minimal web development server with live reload
- Host: GitHub
- URL: https://github.com/morris/s4d
- Owner: morris
- License: isc
- Created: 2024-06-22T12:30:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-15T13:35:47.000Z (12 months ago)
- Last Synced: 2025-03-17T07:44:20.085Z (11 months ago)
- Topics: cli, http, local-development, web
- Language: TypeScript
- Homepage:
- Size: 163 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# s4d
Minimal web development server with live reload.
## Installation
```sh
npm install s4d --save-dev # project local installation (preferred)
npm install s4d --global # global installation
```
## Usage
```
s4d [options]
--help, -h Show this help.
--host Set hostname. Default is "localhost".
Set "0.0.0.0" to expose over network.
--port Set port. Default is 8080.
--spa Single-page application mode.
Serves /index.html for URLs that cannot be resolved to a file.
```
Examples:
```sh
s4d public
s4d --port 3000 public
s4d --port 3000 --spa public
s4d --port 3000 --host 0.0.0.0 --spa public # Expose over network
```
When installed locally in a project, run with `npx s4d [args...]`,
unless running from an npm script.
## Live Reload Behavior
When a file under webroot is modified,
attempts to reload stylesheets and images in-place
if they match the modified file.
In all other cases, a hard page reload is triggered.