RephiWeb.Plugs.FrontendAppPlug (Rephi v0.1.0)
View SourcePlug for serving frontend applications with CSRF token injection.
This plug serves static HTML files from priv/static/apps/ and injects the CSRF token into the HTML before sending it to the client.
Usage
# In router.ex
forward "/app/example", RephiWeb.Plugs.FrontendAppPlug, app: "example"
The plug will:
- Serve the index.html from priv/static/apps/{app_name}/
- Inject CSRF token into a meta tag or script tag
- Serve other static assets without modification