I am not a Python programmer, but the I have used SimpleHTTPServer as it is so simple to start a web server serving from one folder.
Now I need to serve a json file. I have the following python:
update: I should mention that the file should be served from a different route. That is that I need both the "localhost" folder serving an index.html and a folder serving the json file.
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.update: I should mention that the )
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='Certificates.pem', server_side=True)
httpd.serve_forever()
I know that I need to add one more handler serving the file, but how can you have multiple handlers.
The requirement for serving the file is:
1. It must be sent with the header ‘application/pkcs7-mime’
2. It must return a 200 http code
The question is how to server multiple handlers. Thanks in advance. Regards