Skip to content

Make messaging endpoint path configurable#483

Merged
heyitsaamir merged 4 commits intomainfrom
worktree-aamirj/messagingEndpoint
Mar 24, 2026
Merged

Make messaging endpoint path configurable#483
heyitsaamir merged 4 commits intomainfrom
worktree-aamirj/messagingEndpoint

Conversation

@heyitsaamir
Copy link
Copy Markdown
Collaborator

@heyitsaamir heyitsaamir commented Mar 24, 2026

  • Currently /api/messages is hardcoded as the messaging endpoint path. This might not be always what a developer wants.
  • Adds messagingEndpoint 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 httpServer.messagingEndpoint instead of hardcoding

Tested with /my-endpoint and it worked.

corinagum
corinagum previously approved these changes Mar 24, 2026
Copy link
Copy Markdown
Collaborator

@corinagum corinagum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! one nit on the plugin side

Copy link
Copy Markdown
Member

@rido-min rido-min left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@heyitsaamir
Copy link
Copy Markdown
Collaborator Author

heyitsaamir commented Mar 24, 2026

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

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 ^

@heyitsaamir heyitsaamir merged commit dd12f32 into main Mar 24, 2026
7 checks passed
@heyitsaamir heyitsaamir deleted the worktree-aamirj/messagingEndpoint branch March 24, 2026 19:51
heyitsaamir added a commit to microsoft/teams.py that referenced this pull request Mar 24, 2026
## 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]>
@heyitsaamir heyitsaamir mentioned this pull request Mar 25, 2026
2 tasks
HDYA pushed a commit to HDYA/openclaw that referenced this pull request Mar 25, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants