-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9956428
commit da9ba3a
Showing
36 changed files
with
1,009 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:3.8-slim | ||
|
||
RUN apt-get update | ||
|
||
ADD ./requirements.txt /opt/app/requirements.txt | ||
WORKDIR /opt/app/ | ||
|
||
RUN pip install --upgrade pip | ||
|
||
RUN pip install -r ./requirements.txt | ||
|
||
COPY ./ /opt/app/ | ||
|
||
CMD uvicorn --host 0.0.0.0 --port 8080 --workers 4 app:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
import aiohttp | ||
import asyncio | ||
|
||
from domain_logic.__custom_logger import CustomHandler | ||
from domain_logic.cryptographer import Cryptographer | ||
from domain_logic.__constants import * | ||
|
||
cors = { | ||
'Content-Type': 'application/json', | ||
'Access-Control-Allow-Origin': '*', | ||
'Access-Control-Allow-Headers': 'Authorization, Content-Type', | ||
'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, HEAD, OPTIONS', | ||
'Allow': 'POST, OPTIONS' | ||
} | ||
|
||
# Add logic for asynchronous requests | ||
loop = asyncio.get_event_loop() | ||
client = aiohttp.ClientSession(loop=loop) | ||
|
||
# Prepare own helper class objects | ||
cryptographer = Cryptographer(public_key_location=os.getenv('PUBLIC_KEY_LOCATION'), | ||
private_key_location=os.getenv('PRIVATE_KEY_LOCATION')) | ||
|
||
# Prepare own helper class objects | ||
logger = logging.getLogger('root') | ||
if DEBUG_MODE: | ||
logger.setLevel('DEBUG') | ||
else: | ||
logger.setLevel('INFO') | ||
logging.disable(logging.DEBUG) | ||
logger.addHandler(CustomHandler()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.