Metadata-Version: 2.0
Name: sappy
Version: 1.1
Summary: Single-page application server for end-to-end testing.
Home-page: https://github.com/jacebrowning/sappy
Author: Jace Browning
Author-email: jacebrowning@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Testing
Requires-Dist: click (~=6.0.0)

Unix: |Unix Build Status| Windows: |Windows Build Status|\ Metrics:
|Coverage Status| |Scrutinizer Code Quality|\ Usage: |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:

.. code:: sh

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

    $ curl http://localhost:1234/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:

.. code:: sh

    $ 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.5+

Installation
------------

Install ``sappy`` with pip:

.. code:: sh

    $ pip install sappy

or directly from the source code:

.. code:: sh

    $ git clone https://github.com/jacebrowning/sappy.git
    $ cd sappy
    $ python setup.py install

Usage
=====

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

.. code:: sh

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

Then serve up the application:

.. code:: sh

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

Check out the
`documentation <http://sappy.readthedocs.io/en/latest/cli>`__ or
command-line help for additional options:

.. code:: sh

    $ sappy --help

.. |Unix Build Status| image:: http://img.shields.io/travis/jacebrowning/sappy/develop.svg
   :target: https://travis-ci.org/jacebrowning/sappy
.. |Windows Build Status| image:: https://img.shields.io/appveyor/ci/jacebrowning/sappy/develop.svg
   :target: https://ci.appveyor.com/project/jacebrowning/sappy
.. |Coverage Status| image:: http://img.shields.io/coveralls/jacebrowning/sappy/develop.svg
   :target: https://coveralls.io/r/jacebrowning/sappy
.. |Scrutinizer Code Quality| image:: http://img.shields.io/scrutinizer/g/jacebrowning/sappy.svg
   :target: https://scrutinizer-ci.com/g/jacebrowning/sappy/?branch=develop
.. |PyPI Version| image:: http://img.shields.io/pypi/v/sappy.svg
   :target: https://pypi.python.org/pypi/sappy
.. |PyPI Downloads| image:: http://img.shields.io/pypi/dm/sappy.svg
   :target: https://pypi.python.org/pypi/sappy

Revision History
================

1.1 (2017/03/21)
----------------

-  Added handling of HTML pages without the extension.

1.0.1 (2017/03/21)
------------------

-  Fixed handling of relative paths in assets.

1.0 (2017/01/09)
----------------

-  Initial stable release.

0.2 (2016/06/09)
----------------

-  Added a ``--launch`` option to open the page's index.

0.1 (2016/06/09)
----------------

-  Initial release.


