This directory contains small examples of Fastly Compute services built with Python.
- Framework: Bottle (lightweight WSGI framework)
- Demonstrates: Basic routing, JSON responses, WIT API integration
- Use Case: Simple services, proof-of-concept applications
- Framework: Flask (popular Python web framework)
- Demonstrates: Flask routing, request handling, error handling
- Use Case: More complex applications, familiar Flask patterns
- Shows: A server-side implementation of Conway’s Game of Life, with a server round trip per frame.
- Demonstrates: Raw requests-per-second performance; Fastly's session-reuse feature, which saves spin-up time in busy services
This is actually a piece of the test harness; please ignore it.
Before you use make, please install the prerequisites.
make serve # Serve default example (Bottle)
make serve EXAMPLE=flask-app # Serve Flask exampleVisit http://127.0.0.1:7676/hello/world or http://127.0.0.1:7676/info.
make serve EXAMPLE=game-of-life # Serve Conway's Game of Life exampleVisit http://127.0.0.1:7676/.
make list-examples # List all examples
make build-all # Build all examples