diff launch @ 40:df27cf08c093 draft

Add support for serving static files.
author David Barts <n5jrn@me.com>
date Wed, 29 May 2019 09:40:32 -0700
parents ce67eac10fc7
children 997d0c8c174f
line wrap: on
line diff
--- a/launch	Tue May 28 20:20:19 2019 -0700
+++ b/launch	Wed May 29 09:40:32 2019 -0700
@@ -22,11 +22,12 @@
 opt("-e", "--encoding", default=ENCODING, help="encoding to use (default {0})".format(ENCODING))
 opt("-f", "--force", action="store_true", help="do not abort on errors")
 opt("-p", "--port", default=8080, help="port to listen on (default: 8080)")
+opt("-s", "--static", action="store_true", help="serve static files")
 opt("directory", default=".", help="directory to serve", nargs='?')
 opt("path", default="/", help="URL path to serve", nargs='?')
 args = parser.parse_args(sys.argv[1:])
 app, errors = launch(fsroot=args.directory, urlroot=args.path, debug=args.debug,
-    encoding=args.encoding)
+    encoding=args.encoding, static=args.static)
 if errors:
     action = "continuing" if args.force else "aborting"
     sys.stderr.write("{0}: {1} error{2} detected, {3}\n".format(