-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.

1 Answer 1

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/

5
  • 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, 2016 at 19:22
  • 1
    @Calaf stackoverflow.com/questions/13322485/…
    – ceejayoz
    Jun 23, 2016 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, 2016 at 19:55
  • Neither one's really a fit. Both consider your question off-topic.
    – ceejayoz
    Jun 23, 2016 at 19:59
  • ... the 150+ upvotes on the answer you kindly shared notwithstanding, that is :)
    – Calaf
    Jun 23, 2016 at 20:03

Not the answer you're looking for? Browse other questions tagged .