You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from sanic import Sanic, Request, text
|
|
|
|
from sanic.log import logger
|
|
|
|
|
|
|
|
from utils.logger import setup_log, S_LOGGING_CONFIG_DEFAULTS
|
|
|
|
from sdo import bp_sdo
|
|
|
|
from sif import bp_sif
|
|
|
|
|
|
|
|
|
|
|
|
setup_log()
|
|
|
|
app = Sanic("kotori", log_config=S_LOGGING_CONFIG_DEFAULTS)
|
|
|
|
|
|
|
|
app.blueprint(bp_sdo)
|
|
|
|
app.blueprint(bp_sif)
|
|
|
|
|
|
|
|
app.config["PUBKEY_PATH"] = "./publickey.pem"
|
|
|
|
app.config["PRIVKEY_PATH"] = "./privatekey.pem"
|
|
|
|
|
|
|
|
@app.middleware("request")
|
|
|
|
async def callback_request(request: Request):
|
|
|
|
logger.info(f"{request.ip} {request.method} - {request.url}")
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/')
|
|
|
|
async def test(request):
|
|
|
|
return text("(·8·)")
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
app.run(port=8080)
|