Make messaging endpoint path configurable#483
Conversation
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
corinagum
left a comment
There was a problem hiding this comment.
lgtm! one nit on the plugin side
rido-min
left a comment
There was a problem hiding this comment.
can we add an example showing how to configure with a different URL? curious if with this setting we could run to apps with different callback endpoints in the same process
Co-authored-by: Corina <[email protected]>
Hm, I'm not sure if an entire new example is needed to show this option... Maybe just update docs? Ya we could toally have multiple apps with different endpoints: // 1. Create your Express app with your own routes
const expressApp = express();
const httpServer = http.createServer(expressApp);
// 2. Wrap it in the ExpressAdapter
const adapter = new ExpressAdapter(httpServer);
const app1 = new App({ httpServerAdapter: adapter, messagingEndpoint: '/foo' });
await app1.initialize()
const app2 = new App({ httpServerAdapter: adapter, messagingEndpoint: '/bar' });
await app2.initialize()
httpServer.listen(3978, () => console.log('Server ready on http://localhost:3978'));Here both the apps would share the same creds, so we could pass those in manually too if we want them to be serving different bots. This potentially could be a useful example though ^ |
## Summary - Currently `/api/messages` is hardcoded as the messaging endpoint path. This might not be always what a developer wants. - Adds `messaging_endpoint` option to `AppOptions` (defaults to `/api/messages`) - `App` is the source of truth for the default; `HttpServer` requires it explicitly - `BotBuilderPlugin` reads the path from `http_server.messaging_endpoint` instead of hardcoding Port of microsoft/teams.ts#483 ## Test plan - [x] Existing `test_http_server.py` tests pass - [x] New test for default messaging endpoint value - [x] New test for custom messaging endpoint registration - [x] Manual test with a custom endpoint path 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Copilot <[email protected]>
v2.0.6 replaces the '/api*' wildcard Express route (incompatible with
Express 5 / path-to-regexp v8) with explicit route registration via
registerRoute('POST', messagingEndpoint). The messaging endpoint path
is now configurable (defaults to '/api/messages').
Release notes: https://github.com/microsoft/teams.ts/releases/tag/v2.0.6
Relevant PR: microsoft/teams.ts#483
All 338 msteams tests pass.
/api/messagesis hardcoded as the messaging endpoint path. This might not be always what a developer wants.messagingEndpointoption toAppOptions(defaults to/api/messages)Appis the source of truth for the default;HttpServerrequires it explicitlyBotBuilderPluginreads the path fromhttpServer.messagingEndpointinstead of hardcodingTested with
/my-endpointand it worked.