Created
January 17, 2012 18:08
-
-
Save allanlei/1627883 to your computer and use it in GitHub Desktop.
Simple staticfile server for development using fapws
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
pip install fapws3 | |
python staticfile-server.py | |
''' | |
import fapws._evwsgi as evwsgi | |
from fapws import base | |
from fapws.contrib import views | |
from fapws.contrib import zip, log | |
def start(): | |
evwsgi.start('0.0.0.0', '80') | |
evwsgi.set_base_module(base) | |
evwsgi.wsgi_cb(('/css', log.Log()(zip.Gzip()(views.Staticfile('static/css', maxage=2629000))))) | |
evwsgi.wsgi_cb(('/images', log.Log()(views.Staticfile('static/images', maxage=2629000)))) | |
evwsgi.wsgi_cb(('/js', log.Log()(zip.Gzip()(views.Staticfile('static/js', maxage=2629000))))) | |
evwsgi.set_debug(0) | |
evwsgi.run() | |
if __name__ == '__main__': | |
start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment