Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (65 sloc) 3.13 KB

Express utility for Microsoft Teams Apps

npm version

This utility for Express is targeted for Microsoft Teams applications built generated by the Microsoft Teams Yeoman generator hosted on Express.

@master @preview
Build Status Build Status

The Middleware serves two major purposes:

  • Automatic routing of web services for Bots, Connectors and Outgoing Webhooks based on TypeScript decorators
  • Automatic routing of static pages for Tabs and Connectors

The middleware is automatically added to projects generated by the Microsoft Teams Yeoman generator.


For the automatic routing to work the following usage MUST be followed.

Decorator usage for Bots

Bots MUST be implemented as a class implementing the IBot interface and decorated using the BotDeclaration decorator.

import { BotDeclaration, IBot } from 'express-msteams-host';
import * as teamBuilder from 'botbuilder-teams';

export class myBot implements IBot {
    public readonly Connector: teamBuilder.TeamsChatConnector;

Decorator for Connectors

Connectors MUST be implemented as a class implementing the IConnector interface and decorated using the ConnectorDeclaration decorator.

import { ConnectorDeclaration, IConnector } from 'express-msteams-host';
import { Request } from "express";

export class myConnector implements IConnector {
    Connect(req: Request): void {

    Ping(req: Request): Promise<void>[] {

Decorator for Outgoing Webhooks

Outgoing Webhooks MUST be implemented as a class implementing the IOutdegoingWebhook interface and decorated using the OutgoingWebhookDeclaration decorator.

import { OutgoingWebhookDeclaration, IOutgoingWebhook } from 'express-msteams-host';
import * as express from 'express';

export class myOutgoingWebhook implements IOutgoingWebhook {
    public requestHandler(req: Express.Request, res: Express.Response, next: Express.NextFunction): any {


To enable logging from this module you need to add msteams to the DEBUG environment variable. See the debug package for more information.

Example for Windows command line:

SET DEBUG=msteams


Copyright (c) Wictor Wilén. All rights reserved.

Licensed under the MIT license.

You can’t perform that action at this time.