I built a server using JavaScript that displayed a webpage when you connected to it. The server sent the htm file upon connection using
app.get('/', function (req, res) {
res.sendfile('index.htm');
});
Is there a similar function in Python?
import SimpleHTTPServer
import SocketServer
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()