Closed hbons closed 4 years ago
You need Python installed. I thought SimpleHTTPServer shipped with Python.
You don't actually need it for MagicMockup, however... any webserver will do. This is just to start something that should work wherever Python is installed. (It works on my Mac and on Linux w/o a problem.)
Did you compile Python yourself (without proper deps) or something? (:
I moved to Arch Linux, that's probably it... Never mind this. Could we use NodeJS or something instead? That also seems like more in the spirit of the project :)
Okay, I added support for http-server
, from npm. It's basically the node equivalent. I even made both it and Python's server default to port 8000 for consistency.
npm install http-server
I also wrote up how to use it, etc., but github failed to save my edit with a stupid error, and the text I wrote in the README is gone forever, sadly.
(It now defaults to using http-server
, and then tries Python if that doesn't work.)
Try with python3 -m http.server 8000.
Working! Thanks garaPM
If it still does not work write the following code and it should work
import SimpleHTTPServer import SocketServer PORT = 8000 Handler = SimpleHTTPServer.SimpleHTTPRequestHandler httpd = SocketServer.TCPServer(("", PORT), Handler) print "serving at port", PORT httpd.serve_forever()
yeah this is some mid 2010s stuff, doesnt work in these modern, tough times.
Use python -m http.server
. It works for me. :)
By default the port is 8000. No need to specify. If we want to run any other local host we can specify the port number at the end
I think you are using python3. For python3 instead of python -m SimpleHTTPServer
you should use
python3 -m http.server
or python -m http.server
@aruntirath thx man, it's work.
I've updated the script for Python 3.
https://github.com/garrett/magicmockup/commit/be4e913b066980cc3b07cfa0a302f9728b2d46ab
We last worked on this repo around 9 years ago. I guess it's still working (aside from the Python version issue)?
I've updated the CoffeeScript to work with CoffeeScript 2 and recompiled the JS. Additionally, I've (slightly) modified the README to drop the Ruby reference and go with just NPM for installing CoffeeScript.
It's a start.
It's at https://github.com/garrett/magicmockup/pull/17 — I might get the chance to update things coming soon, but if anyone else could test out the branch and provide feedback, that would be appreciated. Perhaps we can modernize things. :wink:
Try with python3 -m http.server 8000.
Thanks!
use python3 -m http.server 80 or python -m http.serve 8080
@garaPM surprised to find this 9 years later and worked. Exactly what I was looking for.Thanks
[hbons@myhost magicmockup]$ ./webserver.sh Visit http://localhost:8000/demo.svg /usr/bin/python: No module named SimpleHTTPServer
which deps do i need? :(