Template Development Server
This is a simple Snippet Server for development of Snippet Templates. It ignores the client configuration including locale, Firefox version and release channels and just returns all the snippets to the requesting client. If you only care for Snippet Template development this is the server for you.
Make sure you're located in the
simple_template_serverdirectory, otherwise you'll be installing requirements for the full snippets service.
Create and activate a Python virtualenv
virtualenv venv . venv/bin/activate
Install the needed packages
pip install -r requirements.txt
Using the server
Make sure you're in
Run the server
The server listens on http://0.0.0.0:8000
If you develop for Activity Stream set the SNIPPETS_STARTPAGE_VERSION environment variable to 5.
SNIPPETS_STARTPAGE_VERSION=5 python webserver.py
Add your templates in the
snippets/directory ending with
.html. If you're developing for Activity Stream use the
Most likely your template will have variables and you can add those in a YAML file under the same directory with the same base filename with
For demo purposes the
snippets_as/ directories already contain
snippet-one.html and the corresponding
snippet-one.yml variable files.
You can add as many snippets you want and all of them will be served to every requesting browser. The server will auto-load the snippets on every request.
Detailed documentation on how to configure Firefox for development and on how to build snippet templates can be found in Snippet Documentation