Files
simple-nanoshare/run.py
T
daniel156161 2982d44e55
Build and Push Docker Container / build-and-push (push) Successful in 3m21s
feat: add servicelink RPC mesh endpoint
- Add the servicelink submodule and register POST /rpc for node-to-node file operations.
- Require bearer tokens with the mesh scope and apply rate/body-size limits to RPC calls.
- Map database connectivity failures to the existing 504 database error flow, with JSON responses for API routes.
- Cover the new RPC handlers and database error handling with focused pytest tests.
- Bump the NanoShare package version to 1.21.0.
2026-06-13 23:59:35 +02:00

32 lines
831 B
Python
Executable File

#!/usr/bin/env -S uv run --script
import quart_flask_patch
import asyncio
asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
from my_modules.app.constens import WEB_DEBUG
import my_modules.middleware
from my_modules.app.setup import app
import routes.handeling.errorsAndBots
from routes import (
basic_bp, auth_login_bp,
side_main_bp,
upload_bp,
health_bp
)
from routes.api.link import link_bp as servicelink_bp
# Views for Requests adding the uris
app.register_blueprint(basic_bp)
app.register_blueprint(auth_login_bp)
app.register_blueprint(side_main_bp)
app.register_blueprint(upload_bp)
# ServiceLink node-to-node mesh endpoint (POST /rpc)
app.register_blueprint(servicelink_bp)
app.register_blueprint(health_bp, url_prefix='/health')
if __name__ == '__main__':
app.run(debug=WEB_DEBUG, port=5502)