Simple web server to serve static files from ONE assigned root-directory.
-
Add it to your project:
bun add github:hyper-hyper/hyper-server
-
Run it from CLI:
hyper-server --watch --hostname localhost --port 8080 ./public
You can run hyper-server --help
to see the help wizard.
Option | Default | Description |
---|---|---|
--hot |
false |
|
-r , --root |
. |
|
-w , --watch |
. |
Watches files for changes and pings on the next available port via WebSocket |
-h , --hostname |
0.0.0.0 |
Server's hostname. When 0.0.0.0 serve both localhost and to local network. |
-p , --port |
3000 |
Port to listen to. Needs sudo to assign ports below 3000. |
-
Hot-reloading (inject client script) -
Server configuration file - Watch mode (Websockets)
- TypeScript support at runtime
- JSX support at runtime
- PHP support at runtime
- SSL support
- Self-Discovery with Bonjour
-
Run commands on remote -
Event Emitter and Key binding
Bun.serve
: https://bun.sh/docs/api/httpDeno.serve
: https://deno.land/std/http/mod.tsgetAvailablePort()
: https://deno.land/std/net/mod.tsHTMLRewriter
: https://developers.cloudflare.com/workers/runtime-apis/html-rewriter/DOMParser
: https://github.com/hyper-hyper/hyper-dom/Commander.js
: https://github.com/tj/commander.jscliffy
: https://github.com/c4spar/deno-cliffybonjour-service
: https://github.com/onlxltd/bonjour-service