Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
dd601efc
Commit
dd601efc
authored
May 11, 2022
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
health-check handler added, port changed to 8000
parent
d66bddc8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
app.py
app.py
+7
-0
config.py
config.py
+1
-1
No files found.
app.py
View file @
dd601efc
...
...
@@ -151,6 +151,12 @@ async def v1_messages(request: Request) -> Response:
return
Response
(
status
=
HTTPStatus
.
OK
)
async
def
v1_health_check
(
_request
:
Request
)
->
Response
:
""" Health check """
# TODO(s1z): Add checks here. DB, etc.
return
Response
(
status
=
HTTPStatus
.
OK
)
@web.middleware
async
def
error_middleware
(
request
,
handler
):
""" Error handler """
...
...
@@ -173,6 +179,7 @@ APP.router.add_post("/api/v1/notification", v1_notification)
APP
.
router
.
add_get
(
"/api/v1/notification/{notification_id}"
,
v1_get_notification
)
APP
.
router
.
add_get
(
"/api/v1/initiations/{notification_id}"
,
v1_get_initiations
)
APP
.
router
.
add_get
(
"/api/v1/health-check"
,
v1_health_check
)
BOT
.
add_web_app
(
APP
)
...
...
config.py
View file @
dd601efc
...
...
@@ -23,7 +23,7 @@ class TaskModuleConfig:
class
AppConfig
:
""" Bot Configuration """
PORT
=
3978
PORT
=
os
.
environ
.
get
(
"HOST_PORT"
,
8000
)
APP_ID
=
os
.
environ
.
get
(
"MS_APP_ID"
,
"d472f12a-323b-4058-b89b-7a4b15c48ab7"
)
APP_PASSWORD
=
os
.
environ
.
get
(
"MS_APP_PASSWORD"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment