返回顶部
s

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
367
下载量
0
收藏
概述
安装方式
版本历史

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: ```bash python scripts/serve.py <path> [--port PORT] ``` **Arguments:** - `<path>`: File path (serves parent directory) or directory path - `--port`: Optional port number (default: 8000) **Examples:** ```bash # 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:** ```javascript // 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: ```bash python -m http.server 8000 --directory /path/to/dir ``` Note: This serves the directory root, not a specific file.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 static-server-1776236161 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 static-server-1776236161 技能

通过命令行安装

skillhub install static-server-1776236161

下载 Zip 包

⬇ 下载 static-server v1.0.0

文件大小: 2.16 KB | 发布时间: 2026-4-15 23:54

v1.0.0 最新 2026-4-15 23:54
Initial release: Python HTTP server for static HTML preview

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部