本文整理汇总了TypeScript中express-web-server.startServer函数的典型用法代码示例。如果您正苦于以下问题:TypeScript startServer函数的具体用法?TypeScript startServer怎么用?TypeScript startServer使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了startServer函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: startServer
authorizationDB.on('connected', () => {
console.log('connected to the database :-)');
startServer(config.webServerConfig, app, (secure:boolean, host:string, port:number) => {
console.log('authentication server listening at %s://%s:%s', (secure ? 'https' : 'http'), host, port);
}, (err: any) => {
console.error('!!! authentication server error: ' + err.code);
});
}).on('error', (err:any) => {
示例2: Date
ews.startServer(config.apiServer, appApi, (secure:boolean, host:string, port:number) => {
console.log('Api server listening at %s://%s:%s', (secure ? 'https' : 'http'), host, port);
ews.startServer(config.proxyServer, appProxy, (secure:boolean, host:string, port:number) => {
console.log('Proxy server listening at %s://%s:%s', (secure ? 'https' : 'http'), host, port);
}, (err: any) => {
console.error(new Date().toISOString() + ": !!! Proxy server error: " + JSON.stringify(err));
});
}, (err: any) => {
示例3: startServer
,redirect_uri: oauth2Options.clientAppSettings.redirect_uri
};
if (state !== '{}') params.state = state;
let redirectUrl = oauth2.Utils.getAuthWorkflowRedirectUrlWithQueryString(oauth2Options.authorizationRedirectUrl, params);
res.redirect(redirectUrl);
}
});
adminApp.get('/logout', (req: express.Request, res: express.Response) => {
if (req.session["access"]) { // browser client
req.session.destroy((err:any) => {
// cannot access any more
if (!err) {
console.log('session destroyed :-)');
console.log("redirecting user's browser to /");
res.redirect('/');
} else {
console.log('unable to destroy session');
res.redirect('about:blank');
}
});
}
});
// evenstream located at:
// admin: /services/events/event_stream
startServer(config.adminWebServerConfig, adminApp, (secure:boolean, host:string, port:number) => {
console.log('admin app server listening at %s://%s:%s', (secure ? 'https' : 'http'), host, port);
});