当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript express-web-server.startServer函数代码示例

本文整理汇总了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) => {
开发者ID:wchang28,项目名称:polaris-auth-serv,代码行数:8,代码来源:app.ts

示例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) => {
开发者ID:wchang28,项目名称:topic-eventsource,代码行数:9,代码来源:app.ts

示例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);
});
开发者ID:wchang28,项目名称:node-grid-2,代码行数:30,代码来源:adminApp.ts


注:本文中的express-web-server.startServer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。