mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-27 04:56:39 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			341 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			341 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from pathlib import Path
 | |
| 
 | |
| from fastapi.staticfiles import StaticFiles
 | |
| 
 | |
| from nonebot.drivers.fastapi import Driver
 | |
| 
 | |
| 
 | |
| def register_route(driver: Driver):
 | |
|     app = driver.server_app
 | |
| 
 | |
|     static_path = str((Path(__file__).parent / ".." / "dist").resolve())
 | |
| 
 | |
|     app.mount("/website", StaticFiles(directory=static_path, html=True), name="docs")
 |