30 lines
1000 B
Python
30 lines
1000 B
Python
|
# Python 3 server example
|
||
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||
|
import time
|
||
|
|
||
|
hostName = "localhost"
|
||
|
serverPort = 80
|
||
|
|
||
|
class MyServer(BaseHTTPRequestHandler):
|
||
|
def do_GET(self):
|
||
|
self.send_response(200)
|
||
|
self.send_header("Content-type", "text/html")
|
||
|
self.end_headers()
|
||
|
self.wfile.write(bytes("<html><head><title>Instalando Tikiwiki</title></head>", "utf-8"))
|
||
|
self.wfile.write(bytes("<body>", "utf-8"))
|
||
|
self.wfile.write(bytes("<p>Estamos instalado y configurando tu Tikiwiki.</p>", "utf-8"))
|
||
|
self.wfile.write(bytes("<p>Espera unos segundos.</p>", "utf-8"))
|
||
|
self.wfile.write(bytes("</body></html>", "utf-8"))
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
webServer = HTTPServer((hostName, serverPort), MyServer)
|
||
|
print("Server started http://%s:%s" % (hostName, serverPort))
|
||
|
|
||
|
try:
|
||
|
webServer.serve_forever()
|
||
|
except KeyboardInterrupt:
|
||
|
pass
|
||
|
|
||
|
webServer.server_close()
|
||
|
print("Server stopped.")
|