@microsoft/teams.apps
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.apps" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.apps/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.apps?activeTab=code
48 lines (47 loc) • 1.66 kB
TypeScript
import http from 'http';
import express from 'express';
import { ExpressAdapter } from '../../http';
import { HttpServer } from '../../http/http-server';
export type HttpPluginOptions = {
/**
* Dangerously allow incoming HTTP requests without Teams service token validation.
*/
readonly dangerouslyAllowUnauthenticatedRequests?: boolean;
readonly messagingEndpoint?: `/${string}`;
};
/**
* @deprecated Use the httpServerAdapter option instead:
* new App({ httpServerAdapter: new ExpressAdapter() })
*
* This wrapper will be removed in a future version.
*
* NOTE: This plugin is named "HttpPlugin" for historical reasons and backwards compatibility.
* It is the default HTTP plugin that uses Express as the underlying framework.
*/
export declare class HttpPlugin {
readonly get: express.Application['get'];
readonly post: express.Application['post'];
readonly patch: express.Application['patch'];
readonly put: express.Application['put'];
readonly delete: express.Application['delete'];
readonly route: express.Application['route'];
readonly use: express.Application['use'];
protected expressAdapter: ExpressAdapter;
protected server: HttpServer;
constructor(server?: http.Server, options?: HttpPluginOptions);
/**
* App.constructor calls this to extract the HttpServer
* @internal
*/
asServer(): HttpServer;
/**
* Plugin lifecycle hook
*/
onInit(): Promise<void>;
/**
* serve static files
* @param path the url path to serve
* @param dist the dist file path to serve
*/
static(path: string, dist: string): this;
}