mirror of
https://github.com/clearlinux/graphene.git
synced 2026-06-25 15:36:11 +00:00
6c7ff2d3a6
We decided to merge the sample app integrations submodule back because working with git submodules turned out to be really painful. The only blocker for this was the fact, that previously it contained a lot of binary blobs and copy-pasted sources, but this was cleaned up recently. Credits: (authors of particular integration examples, extracted from commits and PR history in https://github.com/oscarlab/graphene-tests) apache: Chia-Che Tsai <chiache@tamu.edu>, Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> bash: Chia-Che Tsai <chiache@tamu.edu>, Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> blender: borysp <borysp@invisiblethingslab.com> busybox: borysp <borysp@invisiblethingslab.com> capnproto: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> curl: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> gcc: Thomas Knauth <thomas.knauth@intel.com> lighttpd: Chia-Che Tsai <chiache@tamu.edu>, Thomas Knauth <thomas.knauth@intel.com> lmbench: Chia-Che Tsai <chiache@tamu.edu> memcached: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> nginx: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> nodejs: jack.wxz <jack.wxz@alibaba-inc.com> nodejs-express-server: Eduardo Rodriguez <erodrig@us.ibm.com> openvino: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> python-scipy-insecure: Chia-Che Tsai <chiache@tamu.edu>, Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> python-simple: Chia-Che Tsai <chiache@tamu.edu>, Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> pytorch: Thomas Knauth <thomas.knauth@intel.com> r: Chia-Che Tsai <chiache@tamu.edu> redis: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com> tensorflow: Thomas Knauth <thomas.knauth@intel.com> LTP was moved to LibOS/shim/test/ltp. It was recently rewritten by Wojtek Porczyk <woju@invisiblethingslab.com>.
55 lines
1.3 KiB
Python
55 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
|
|
"""
|
|
Very simple HTTP server in python.
|
|
Downloaded from: https://gist.github.com/bradmontgomery/2219997
|
|
|
|
Usage::
|
|
./dummy-web-server.py [<port>]
|
|
|
|
Send a GET request::
|
|
curl http://localhost
|
|
|
|
Send a HEAD request::
|
|
curl -I http://localhost
|
|
|
|
Send a POST request::
|
|
curl -d "foo=bar&bin=baz" http://localhost
|
|
|
|
"""
|
|
|
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
import socketserver
|
|
|
|
class S(BaseHTTPRequestHandler):
|
|
def _set_headers(self):
|
|
self.send_response(200)
|
|
self.send_header('Content-type', 'text/html')
|
|
self.end_headers()
|
|
|
|
def do_GET(self):
|
|
self._set_headers()
|
|
self.wfile.write("<html><body><h1>hi!</h1></body></html>".encode())
|
|
|
|
def do_HEAD(self):
|
|
self._set_headers()
|
|
|
|
def do_POST(self):
|
|
# Doesn't do anything with posted data
|
|
self._set_headers()
|
|
self.wfile.write("<html><body><h1>POST!</h1></body></html>".encode())
|
|
|
|
def run(server_class=HTTPServer, handler_class=S, port=80):
|
|
server_address = ('', port)
|
|
httpd = server_class(server_address, handler_class)
|
|
print('Starting httpd...')
|
|
httpd.serve_forever()
|
|
|
|
if __name__ == "__main__":
|
|
from sys import argv
|
|
|
|
if len(argv) == 2:
|
|
run(port=int(argv[1]))
|
|
else:
|
|
run()
|