Skip to content

Commit fc301aa

Browse files
committed
Add banner to startup
Apart from adding the ASCII DEEP logo, we add some information about the endpoints.
1 parent cdcce18 commit fc301aa

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

deepaas/cmd/run.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@
6666
CONF = cfg.CONF
6767
CONF.register_cli_opts(cli_opts)
6868

69+
INTRO = """
70+
## ###
71+
## ###### ##
72+
.##### ##### #######. .#####.
73+
## ## ## // ## // ## ## ##
74+
##. .## ### ### // ### ## ##
75+
## ## #### #### #####.
76+
Hybrid-DataCloud ##
77+
"""
78+
79+
BANNER = """
80+
Welcome to the DEEPaaS API API endpoint. You can directly browse to the
81+
API documentation endpoint to check the API using the builtint Swagger UI
82+
or you can use any of our endpoints.
83+
84+
API documentation: {}
85+
API specification: {}
86+
V2 endpoint: {}
87+
88+
-------------------------------------------------------------------------
89+
"""
90+
6991

7092
def main():
7193
_shutdown.handle_signals()
@@ -79,9 +101,17 @@ def main():
79101

80102
proxy.main()
81103
else:
104+
base = "http://{}:{}".format(CONF.listen_ip, CONF.listen_port)
105+
spec = "{}/swagger.json".format(base)
106+
docs = "{}/docs".format(base)
107+
v2 = "{}/v2".format(base)
108+
109+
print(INTRO)
110+
print(BANNER.format(docs, spec, v2))
111+
82112
log.info("Starting DEEPaaS version %s", deepaas.__version__)
83113

84-
app = api.get_app()
114+
app = api.get_app(doc="/docs")
85115
web.run_app(
86116
app,
87117
host=CONF.listen_ip,

0 commit comments

Comments
 (0)