generated from BlockchainCommons/secure-template
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
app.py
38 lines (28 loc) · 895 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import enum
class Network(enum.Enum):
BITCOIN = 'bitcoin'
TESTNET = 'testnet'
SIGNET = 'signet'
REGTEST = 'regtest'
if __name__ == '__main__':
import typer
import server
def make_cli(logger):
cli = typer.Typer()
@cli.command()
def run():
import uvicorn
assert logger
logger.info(f'debug: {server.app.debug}')
uvicorn.run('server:app',
host ='127.0.0.1',
port = 5000,
debug = server.settings.debug,
log_level = 'debug' if server.settings.debug else 'info',
reload = server.settings.debug,
reload_includes = ['spotbit.config'] # FIXME(nochiel) Does nothing?
)
return cli
cli = make_cli(server.logger)
assert cli
cli()