Skip to main content
edited body
Source Link
enzotib
  • 53.4k
  • 14
  • 126
  • 106

Try using SimpleHTTPServer in Python.

mkdir ~/public_html
command_to_generate_output > ~/public_html/output.txt

(cd ~/public_html; python -c 'import SimpleHTTPServer,BaseHTTPServer; BaseHTTPServer.HTTPServer(("", 8080), SimpleHTTPServer.SimpleHTTPRequestHandler).serve_forever()')

The first two lines are setup for the web server. The last line creates a simple web server, opened on port 8080, which only serves filsefiles from ~/public_html. If only one file is in that directory, then only that is exposed: "http://localhost:8080/output.txt" http://localhost:8080/output.txt.

Try using SimpleHTTPServer in Python.

mkdir ~/public_html
command_to_generate_output > ~/public_html/output.txt

(cd ~/public_html; python -c 'import SimpleHTTPServer,BaseHTTPServer; BaseHTTPServer.HTTPServer(("", 8080), SimpleHTTPServer.SimpleHTTPRequestHandler).serve_forever()')

The first two lines are setup for the web server. The last line creates a simple web server, opened on port 8080, which only serves filse from ~/public_html. If only one file is in that directory, then only that is exposed: "http://localhost:8080/output.txt".

Try using SimpleHTTPServer in Python.

mkdir ~/public_html
command_to_generate_output > ~/public_html/output.txt

(cd ~/public_html; python -c 'import SimpleHTTPServer,BaseHTTPServer; BaseHTTPServer.HTTPServer(("", 8080), SimpleHTTPServer.SimpleHTTPRequestHandler).serve_forever()')

The first two lines are setup for the web server. The last line creates a simple web server, opened on port 8080, which only serves files from ~/public_html. If only one file is in that directory, then only that is exposed: http://localhost:8080/output.txt.

Source Link
Arcege
  • 22.9k
  • 5
  • 58
  • 65

Try using SimpleHTTPServer in Python.

mkdir ~/public_html
command_to_generate_output > ~/public_html/output.txt

(cd ~/public_html; python -c 'import SimpleHTTPServer,BaseHTTPServer; BaseHTTPServer.HTTPServer(("", 8080), SimpleHTTPServer.SimpleHTTPRequestHandler).serve_forever()')

The first two lines are setup for the web server. The last line creates a simple web server, opened on port 8080, which only serves filse from ~/public_html. If only one file is in that directory, then only that is exposed: "http://localhost:8080/output.txt".