Automated update of Base Application package.
This commit is contained in:
parent
9f57af3ad1
commit
361961cad4
BIN
dist/app-1.0.0-py3-none-any.whl
vendored
BIN
dist/app-1.0.0-py3-none-any.whl
vendored
Binary file not shown.
BIN
dist/app-1.0.0.tar.gz
vendored
BIN
dist/app-1.0.0.tar.gz
vendored
Binary file not shown.
@ -1,8 +1,9 @@
|
|||||||
|
import argparse
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
import argparse
|
|
||||||
import dataset
|
import dataset
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
@ -243,58 +244,49 @@ class Application(WebDbApplication):
|
|||||||
content_type="application/json",
|
content_type="application/json",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
argument_parser = argparse.ArgumentParser("Web service")
|
argument_parser = argparse.ArgumentParser("Web service")
|
||||||
argument_parser.add_argument(
|
argument_parser.add_argument(
|
||||||
"--host",
|
"--host", default="0.0.0.0", required=False, type=str, help="Host to serve on."
|
||||||
default="0.0.0.0",
|
|
||||||
required=False,
|
|
||||||
type=str,
|
|
||||||
help="Host to serve on."
|
|
||||||
)
|
)
|
||||||
argument_parser.add_argument(
|
argument_parser.add_argument(
|
||||||
"--port",
|
"--port", default=8888, required=False, type=int, help="Port to serve on."
|
||||||
default=8888,
|
|
||||||
required=False,
|
|
||||||
type=int,
|
|
||||||
help="Port to serve on."
|
|
||||||
)
|
)
|
||||||
argument_parser.add_argument(
|
argument_parser.add_argument(
|
||||||
"--db-path",
|
"--db-path",
|
||||||
default="sqlite:///:memory:",
|
default="sqlite:///:memory:",
|
||||||
required=False,
|
required=False,
|
||||||
type=str,
|
type=str,
|
||||||
help="SQLAlchemy db url. (e.g. sqlite:///app.db)"
|
help="SQLAlchemy db url. (e.g. sqlite:///app.db)",
|
||||||
)
|
)
|
||||||
argument_parser.add_argument(
|
argument_parser.add_argument(
|
||||||
"--basic-username",
|
"--basic-username",
|
||||||
default=None,
|
default=None,
|
||||||
required=False,
|
required=False,
|
||||||
type=str,
|
type=str,
|
||||||
help="Basic Auth username."
|
help="Basic Auth username.",
|
||||||
)
|
)
|
||||||
argument_parser.add_argument(
|
argument_parser.add_argument(
|
||||||
"--basic-password",
|
"--basic-password",
|
||||||
default=None,
|
default=None,
|
||||||
required=False,
|
required=False,
|
||||||
type=str,
|
type=str,
|
||||||
help="Basic Auth password."
|
help="Basic Auth password.",
|
||||||
)
|
)
|
||||||
argument_parser.add_argument(
|
argument_parser.add_argument(
|
||||||
"--db-web",
|
"--db-web", action="store_true", help="Enable /db/* endpoints", default=False
|
||||||
action="store_true",
|
|
||||||
help="Enable /db/* endpoints",
|
|
||||||
default=False
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def create_app(*args, **kwargs):
|
def create_app(*args, **kwargs):
|
||||||
global argument_parser
|
global argument_parser
|
||||||
args = argument_parser.parse_args()
|
args = argument_parser.parse_args()
|
||||||
app = create_app(db_path=args.db_path,db_web=args.db_web,basic_username=args.basic_username,basic_password=args.basic_password)
|
app = create_app(
|
||||||
|
db_path=args.db_path,
|
||||||
|
db_web=args.db_web,
|
||||||
|
basic_username=args.basic_username,
|
||||||
|
basic_password=args.basic_password,
|
||||||
|
)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user