static-server

Start a local HTTP server to preview static HTML pages. Use when testing static pages, previewing HTML files, or when browser tools cannot access file:// URLs. Provides localhost URL for browser testing.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "static-server" with this command: npx skills add liujintao-2021/static-server

Static Server

Start a Python HTTP server to preview static HTML files in a browser.

When to Use

  • Testing static HTML pages
  • Previewing web pages before deployment
  • When browser tools block file:// protocol
  • Need a localhost URL for browser automation

Quick Start

Use the bundled script to start a server:

python scripts/serve.py <path> [--port PORT]

Arguments:

  • <path>: File path (serves parent directory) or directory path
  • --port: Optional port number (default: 8000)

Examples:

# Serve a specific HTML file
python scripts/serve.py /path/to/index.html

# Serve a directory
python scripts/serve.py /path/to/project

# Use custom port
python scripts/serve.py /path/to/index.html --port 9000

Output

The script prints:

  • Access URL: http://localhost:PORT/filename.html
  • Directory being served
  • Instructions to stop (Ctrl+C)

Usage in Testing

When testing static pages with browser tools:

  1. Start server with exec (background mode)
  2. Use the localhost URL with browser tools
  3. Complete testing
  4. Kill the server process

Example workflow:

// 1. Start server in background
exec({
  command: "python scripts/serve.py /path/to/index.html --port 8888",
  background: true
})

// 2. Open in browser
browser({
  action: "open",
  targetUrl: "http://localhost:8888/index.html"
})

// 3. Test and screenshot
browser({ action: "screenshot", fullPage: true })

// 4. Clean up
process({ action: "kill", sessionId: "..." })
browser({ action: "close" })

Alternative: One-liner

For quick testing without the script:

python -m http.server 8000 --directory /path/to/dir

Note: This serves the directory root, not a specific file.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Dlazy Kling Audio Clone

Generate customized speech that highly restores the timbre by uploading reference audio using Kling Audio Clone.

Registry SourceRecently Updated
General

Dlazy Keling Sfx

Generate matching scene sound effects based on text descriptions or video frames using Kling SFX.

Registry SourceRecently Updated
General

Dlazy Keling Tts

Convert text into high-quality, emotional speech reading using Kling TTS.

Registry SourceRecently Updated
General

Dlazy Jimeng T2i

Text-to-image generation with Jimeng, quickly converting text to high-quality images.

Registry SourceRecently Updated