Live Server

Live Server

Ariadne Lv13

Launch a local network server with live reload feature for static pages.

Binary

You can use it as a CLI program.

PearlMountain Image Converter

Install

1
$ cargo install live-server

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ live-server --help
Launch a local network server with live reload feature for static pages

Usage: live-server.exe [OPTIONS] [ROOT]

Arguments:
[ROOT] Set the root path of the static assets [default: .]

Options:
-H, --host <HOST> Set the listener host [default: 0.0.0.0]
-p, --port <PORT> Set the listener port [default: 0]
-o, --open Open the page in browser automatically
-h, --help Print help
-V, --version Print version
1
2
3
$ live-server
[2023-12-22T15:16:04Z INFO live_server::server] Listening on http://10.17.95.220:6634/
[2023-12-22T15:16:04Z INFO live_server::watcher] Listening on /home/mirus/html-demo

Log Level

You can set different RUST_LOG environment variable to filter the log. The default log level is info.

Package

You can also import it as a library in your project.

EaseText Audio to Text Converter for Windows (Personal Edition) - An intelligent tool to transcribe & convert audio to text freely

Create live server

1
2
3
use live_server::listen;

listen("127.0.0.1:8080", "./").await?.start().await?;

Enable logs (Optional)

1
env_logger::init();

  • Title: Live Server
  • Author: Ariadne
  • Created at : 2024-07-30 11:25:38
  • Updated at : 2024-09-25 22:42:43
  • Link: https://howto.techidaily.com/rust/live-server/
  • License: This work is licensed under CC BY-NC-SA 4.0.