Prev | Index | Next

Making a runnable application

# this is web.py
from twisted.internet import app
from twisted.web import static, server

application = app.Application('web')
application.listenTCP(8080, server.Site(
    static.File('/var/www')))

if __name__ == '__main__':
    application.run(save=0)