Skip to content

Instantly share code, notes, and snippets.

@alecordev
Created June 7, 2017 11:31
Show Gist options
  • Save alecordev/b154f003edaa8b8415ec063ed4221b60 to your computer and use it in GitHub Desktop.
Save alecordev/b154f003edaa8b8415ec063ed4221b60 to your computer and use it in GitHub Desktop.
Simple Twisted Server in Current Directory
import sys
from twisted.web.static import File
from twisted.python import log
from twisted.web.server import Site
from twisted.internet import reactor
log.startLogging(sys.stdout)
root = File('.')
site = Site(root)
reactor.listenTCP(8080, site)
reactor.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment