-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
14 changed files
with
109 additions
and
41 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
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 @@ | ||
tests/ |
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 |
---|---|---|
@@ -1,22 +1,27 @@ | ||
from flask import Flask | ||
|
||
from app.config import PgConfig | ||
from app.config import PostgresClientConfig | ||
|
||
|
||
def create_app(): | ||
app = Flask(__name__) | ||
|
||
from app.routes import bp as blueprint | ||
app.register_blueprint(blueprint) | ||
|
||
from app.config import Config | ||
from app.config import BackendApiConfig | ||
app.config.from_mapping({ | ||
"SECRET_KEY": Config.SECRET_KEY, | ||
"AUTH_TOKEN_DURATION": Config.AUTH_TOKEN_DURATION, | ||
"AUTH_BEGIN_TIMESTAMP": Config.AUTH_BEGIN_TIMESTAMP | ||
"SECRET_KEY": BackendApiConfig.SECRET_KEY, | ||
"AUTH_TOKEN_DURATION": BackendApiConfig.AUTH_TOKEN_DURATION, | ||
"AUTH_BEGIN_TIMESTAMP": BackendApiConfig.AUTH_BEGIN_TIMESTAMP | ||
}) | ||
|
||
app.config.from_object(PgConfig()) | ||
app.config.from_object(PostgresClientConfig()) | ||
|
||
return app | ||
|
||
|
||
app = create_app() | ||
|
||
|
||
__all__ = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from . import app | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0', port=5000) | ||
app.run(host='0.0.0.0', port=5050) |
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
6 changes: 4 additions & 2 deletions
6
services/backend_api/src/app/db.py → services/backend_api/src/app/database.py
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from flask import g, current_app | ||
import psycopg2 | ||
|
||
|
||
def get_db(): | ||
if 'db' not in g: | ||
g.db = psycopg2.connect(host=current_app.config['POSTGRES_HOST'], | ||
database=current_app.config['POSTGRES_DB'], | ||
user=current_app.config['POSTGRES_USER']) | ||
#password=current_app.config['POSTGRES_PASSWORD']) | ||
|
||
return g.db | ||
|
||
|
||
__all__ = get_db, |
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 @@ | ||
07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 tini-arm64 |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
from .contracts_relayer import ContractsRelayer as ContractsRelayerConfig | ||
from .postgres_client import PostgresClient as PostgresClientConfig | ||
|
||
|
||
__all__ = ContractsRelayerConfig, PostgresClientConfig, |