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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sappy-1.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sappy-1.3-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file sappy-1.3.tar.gz.

File metadata

  • Download URL: sappy-1.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Darwin/24.6.0

File hashes

Hashes for sappy-1.3.tar.gz
Algorithm Hash digest
SHA256 c8ae9466d61666743e3fb5e3eeefef39cd344ba7f819e01c696d7cec1e80787f
MD5 a15f5f32c678cd61dd15b8b8c5b79181
BLAKE2b-256 2389a92b372bbcaf18f04b1cf6a3d144ceb8872165ac31760f1ce6475e5e205b

See more details on using hashes here.

File details

Details for the file sappy-1.3-py3-none-any.whl.

File metadata

  • Download URL: sappy-1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Darwin/24.6.0

File hashes

Hashes for sappy-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a613d1a444db21da88e9b05e664fdd7b9c90a96ae782190237f47069c1e6db79
MD5 8de9ce57639352281cc858f50201c7fe
BLAKE2b-256 a94441fd50302bf091acd8c238fda3a293f1996e81d2df49541f683796600cee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page