Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

spark

> 编程语言
Open source

Emergency web server

652 stars0 likes0 views
WebsiteGitHub

About

Emergency web server

spark

Emergency web server

For those occasions when your webserver is down and you want to display a quick maintainance note. Or just want to quickly demo a static site. Or whatever :)

It can take a directory, a file or directly the body string. The -proxy flag can be useful when used as a development server.

…

install

  • from source
go get github.com/rif/spark
  • static binaries (linux/arm/osx/windows): Binary downloads

examples

$ spark message.html
$ spark "
Out of order

Working on it...
"
$ spark static_site/
$ spark -port 80 -sslPort 443 "
Ooops!
"
$ spark -deny ".git*,LICENSE" ~/go/rif/spark
$ spark -proxy "/api=>http://localhost:9090/api" .
$ spark -port 9000 -corsOrigin "https://www.mydomain.com" -contentType "application/json" '{"message":"Hello"}'

new features

echo endpoint

The /echo endpoint returns request details (method, headers, body) for debugging:

$ spark "Hello" &
$ curl -X POST http://localhost:8080/echo -d '{"test": "data"}'

mock server

Create mock API responses using directory structure:

# Directory structure defines endpoints
mock/
  users/
    GET              # responds to GET /users
    POST_201         # responds to POST /users with 201 status
  api/
    products/
      GET            # responds to GET /api/products

# Start mock server
$ spark -mock mock/

# Test endpoints
$ curl http://localhost:8080/users
$ curl -X POST http://localhost:8080/users

Files are named after HTTP verbs (case-insensitive). Add _STATUS suffix for custom status codes (e.g., POST_201, DELETE_204). Returns 405 Method Not Allowed for unsupported methods.

ssl certificate

To quickly generate a ssl certificate run:

go run $GOROOT/src/crypto/tls/generate_cert.go --host="localhost"

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言