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)
| File | Size | Uploaded | |
|---|---|---|---|
| sappy-1.3.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|