-3

After writing foo.html with some CSS and some JavaScript, I test it on Safari, Firefox, and Chrome, and see that all is well.

I'd now like to debug the files on iOS and Android.

What is the lightest weight server I can launch from the command line? I would like to run in the Terminal:

> runserver .

to be able subsequently to point browsers to, say, http://192.168.5.2/foo.html on either an Android or an iOS device on the local network, and see the file.

closed as off-topic by Sven Jun 23 '16 at 18:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1

On OSX, Python's SimpleHTTPServer is probably your best bet.

https://docs.python.org/2/library/simplehttpserver.html

python -m SimpleHTTPServer 8000

will serve the current directory at http://localhost:8000/

  • Perfect, yet somehow incomplete! I can look at what netstat says and figure out the IP to connect to from other machines/devices on the network. If you know of a command-line statement that will produce just the IP needed, please share it. – Calaf Jun 23 '16 at 19:22
  • 1
    @Calaf stackoverflow.com/questions/13322485/… – ceejayoz Jun 23 '16 at 19:29
  • This is great. It should be in everyone's ~/.bash_profile. I'm puzzled by the downvotes. I wish they would state their objections. Is stackoverflow a better fit than serverfault for this kind of question? – Calaf Jun 23 '16 at 19:55
  • Neither one's really a fit. Both consider your question off-topic. – ceejayoz Jun 23 '16 at 19:59
  • ... the 150+ upvotes on the answer you kindly shared notwithstanding, that is :) – Calaf Jun 23 '16 at 20:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.