Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morris/s4d
Minimal web development server with live reload
https://github.com/morris/s4d
cli http local-development web
Last synced: 24 days 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 (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T08:44:26.000Z (29 days ago)
- Last Synced: 2024-08-23T09:52:25.995Z (29 days ago)
- Topics: cli, http, local-development, web
- Language: TypeScript
- Homepage:
- Size: 128 KB
- Stars: 0
- 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.