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.
		
		
		
		
		
			
		
			
				
					
					
						
							31 lines
						
					
					
						
							627 B
						
					
					
				
			
		
		
	
	
							31 lines
						
					
					
						
							627 B
						
					
					
				| from sanic import Sanic, Request
 | |
| from sanic.response import json
 | |
| from sanic.log import logger
 | |
| 
 | |
| from logger import setup_log, S_LOGGING_CONFIG_DEFAULTS
 | |
| 
 | |
| from sdo import bp_sdo
 | |
| 
 | |
| 
 | |
| 
 | |
| setup_log()
 | |
| app = Sanic("kotori", log_config=S_LOGGING_CONFIG_DEFAULTS)
 | |
| 
 | |
| app.blueprint(bp_sdo)
 | |
| 
 | |
| 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.method} - {request.path}")
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| @app.route('/')
 | |
| async def test(request):
 | |
|     return json({'hello': 'world'})
 | |
| 
 | |
| if __name__ == '__main__':
 | |
|     app.run(port=8080) |