magpie/app/api/routes.py
pyr0ball add5475d50 feat: add Directus blog post publisher and MCP tool
- app/services/directus.py: Directus CMS client using docker run
  curlimages/curl on website_cf-internal network; supports static admin
  token with fresh JWT login fallback; get/publish/update blog_posts
- app/api/endpoints/blog.py: POST /api/v1/blog (publish), GET /slug,
  PATCH /id endpoints
- app/api/routes.py: register blog router
- app/core/config.py: add directus_url/token/email/password/network settings
- mcp/server.js: add publish_blog_post and get_blog_post MCP tools

Key gotcha: Directus filter[field][_eq] brackets must be percent-encoded
when passed as a curl CLI URL arg — raw brackets cause curl to exit
non-zero with empty stderr.
2026-04-26 14:14:35 -07:00

13 lines
569 B
Python

from fastapi import FastAPI
from app.api.endpoints import blog, campaigns, opportunities, posts, scheduler, signals, subs
def register_routes(app: FastAPI) -> None:
app.include_router(campaigns.router, prefix="/api/v1")
app.include_router(posts.router, prefix="/api/v1")
app.include_router(subs.router, prefix="/api/v1")
app.include_router(scheduler.router, prefix="/api/v1")
app.include_router(opportunities.router, prefix="/api/v1")
app.include_router(signals.router, prefix="/api/v1")
app.include_router(blog.router, prefix="/api/v1")