4
This is simple all-in-one self-containing server,
5
which just shows almost-empty HTML page
9
# here we import server, which is derivative of
10
# BaseHTTPServer from python standard library
11
from pypy.translator.js.lib import server
13
# We create handler, which will handle all our requests
14
class Handler(server.TestHandler):
17
# provide some html contents
18
return "<html><head></head><body><p>Something</p></body></html>"
19
# this line is necessary to make server show something,
20
# otherwise method is considered private-only
23
if __name__ == '__main__':
24
# let's start our server,
25
# this will create running server instance on port 8000 by default,
26
# which will run until we press Control-C
27
server.create_server(handler=Handler).serve_forever()