Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple staticfile server for development using fapws
#!/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
You can’t perform that action at this time.