The Arc HTTP contract on Plug.
Add it to a Phoenix endpoint, before the router, or to any Plug pipeline:
plug Arc.Plug, application: MyApp.ArcRequests that are not Arc routes pass through untouched, so the plug can sit in front of the rest of your application. It serves:
POSTcommand routes andPOST <route>/validateGETandQUERYquery routes, including paging and sorting- observable queries as an HTTP snapshot, direct Server-Sent Events and direct WebSocket
- the multiplexed hubs: WebSocket at
/.cratis/queries/wsand Server-Sent Events at/.cratis/queries/ssewith itssubscribeandunsubscribecontrol routes /.cratis/commands,/.cratis/queries,/.cratis/me,/.cratis/identity-details/schema,/.cratis/usersand/.cratis/tenants
Routes are derived from module names: MyApp.Authors.Registration.RegisterAuthor becomes
POST /api/authors/registration/register-author with the default segments_to_skip: 1.
Use the plug after authentication has run (so Arc.Authentication handlers can see the
caller) and before Plug.Parsers is optional - Arc reads the body itself when it is unread.