GithubHelp home page GithubHelp logo

samirtalwar / one-track-web-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 15 KB

Sometimes you just need a web server that runs the same command over and over again.

Python 49.66% Makefile 10.57% Shell 36.38% Dockerfile 3.39%

one-track-web-server's Introduction

One Track Web Server

Sometimes you just need a web server that runs the same command over and over again.

I wrote this as a server to dump log files to a web page so that people could iterate quickly. It's been generalised a bit.

Running

Simple enough. Just use Docker:

docker run -p <port>:8080 -it samirtalwar/one-track-web-server <your command>

For example, if you want to serve up a file located at /my/directory/file:

docker run -v /my/directory/file:/data/file -p 80:8080 -it samirtalwar/one-track-web-server cat /data/file

Or generate a random number:

docker run --rm -it -p 80:8080 samirtalwar/one-track-web-server python -c 'import random; print("Your random number is {}!".format(random.randint(1, 100)))'

Then just head to http://localhost/ to see the results.

Ports

The default port is 8080. You can override it with the -p switch or the PORT environment variable. (The switch takes precedence.)

Building

make build

Testing

make check

one-track-web-server's People

Contributors

samirtalwar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.