Although you can run Python Simple HTTP Server by just typing:
It does not serve svg images with correct mime type. To add your own mime type for svg files, run it like this:
Make sure to use correct the location of python (#!/usr/bin/python).
python -m SimpleHTTPServer 8000
It does not serve svg images with correct mime type. To add your own mime type for svg files, run it like this:
#!/usr/bin/python
import SimpleHTTPServer
import SocketServer
import mimetypes
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
Handler.extensions_map['.svg']='image/svg+xml'
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
import SimpleHTTPServer
import SocketServer
import mimetypes
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
Handler.extensions_map['.svg']='image/svg+xml'
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
Make sure to use correct the location of python (#!/usr/bin/python).