Skip to main content

Unix Build Status Windows Build Status Coverage Status PyPI License PyPI Version PyPI Downloads

Overview

Sappy is a simple, single-page application (SPA) web server for end-to-end testing.

The Python standard library includes a web server that works great for serving up files:

$ python3 -m http.server 8080
Serving HTTP on 0.0.0.0 port 8080 ...

$ curl http://localhost:8080/index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Example Index</title>
...

But when used to serve up single-page applications, a 404 is returned whenever any page other than the index is accessed directly:

$ curl http://localhost:8080/login
<!DOCTYPE html>
<html lang=en>
  <title>Error 404 (Not Found)</title
...

This project builds on the existing web server code to forward all requests to the index. The single-page application’s client-side routing can then display the page that corresponds to that request’s URL.

Setup

Requirements

  • Python 3.10+

Installation

Install this tool globally with pipx (or pip):

$ pipx install sappy

or add it to your Poetry project:

$ poetry add sappy

Usage

Build your static website (e.g. an Ember application) for production:

$ ember build --environment=production
Building...
Built project successfully. Stored in "dist/".

Then serve up the application:

$ sappy
Serving /home/browning/project/dist/ on 8080

Check out the documentation or command-line help for additional options:

$ sappy --help

Metadata

Release files for sappy 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sappy 1.3
File Size Uploaded
sappy-1.3.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sappy 1.3
File Interpreter ABI Platform
sappy-1.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / sappy-1.3.tar.gz

Download URL sappy-1.3.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c8ae9466d61666743e3fb5e3eeefef39cd344ba7f819e01c696d7cec1e80787f
BLAKE2b-256 checksum
How to use checksums
2389a92b372bbcaf18f04b1cf6a3d144ceb8872165ac31760f1ce6475e5e205b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.5 Darwin/24.6.0

Release files / sappy-1.3-py3-none-any.whl

Download URL sappy-1.3-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a613d1a444db21da88e9b05e664fdd7b9c90a96ae782190237f47069c1e6db79
BLAKE2b-256 checksum
How to use checksums
a94441fd50302bf091acd8c238fda3a293f1996e81d2df49541f683796600cee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.5 Darwin/24.6.0

Release history Release notifications | RSS feed

This release

1.3 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0.1

2 release files

1.0

2 release files

0.2.1

1 release file

0.2

2 release files

0.1

2 release files

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page