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


TypeScript get-port.default函数代码示例

本文整理汇总了TypeScript中get-port.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了default函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: startNonCodeNodeKibana

  before(async function() {
    nonCodePort = await getPort();
    codePort = await getPort();

    // @ts-ignore
    await startServers.bind(this)();
    await startNonCodeNodeKibana();
  });
开发者ID:elastic,项目名称:kibana,代码行数:8,代码来源:multi_node.ts

示例2: buildGoExecutable

export const newTest = async (pluginsDir = ''): Promise<GotifyTest> => {
    const port = await getPort();

    const gotifyFile = testFilePath();

    await buildGoExecutable(gotifyFile);

    const gotifyInstance = startGotify(gotifyFile, port, pluginsDir);

    const gotifyURL = 'http://localhost:' + port;
    await waitForGotify('http-get://localhost:' + port);
    const browser = await puppeteer.launch({
        headless: process.env.CI === 'true',
        args: [`--window-size=1920,1080`, '--no-sandbox'],
    });
    const page = await browser.newPage();
    await page.setViewport({width: 1920, height: 1080});
    await page.goto(gotifyURL);

    return {
        close: async () => {
            await Promise.all([
                browser.close(),
                new Promise((resolve) => kill(gotifyInstance.pid, 'SIGKILL', () => resolve())),
            ]);
            rimraf.sync(gotifyFile, {maxBusyTries: 8});
        },
        url: gotifyURL,
        browser,
        page,
    };
};
开发者ID:bradparks,项目名称:server,代码行数:32,代码来源:setup.ts

示例3: suiteSetup

    suiteSetup(async () => {
        let port = await getPort();
        server = new ServerMock(null,
            {
                host: "localhost",
                port: port,
                key: await fs.readFile("test/unitTests/testAssets/private.pem"),
                cert: await fs.readFile("test/unitTests/testAssets/public.pem")
            });

        httpsServerUrl = `https://127.0.0.1:${port}`;
    });
开发者ID:peterblazejewicz,项目名称:omnisharp-vscode,代码行数:12,代码来源:FileDownloader.test.ts

示例4: setPort

 function setPort(name: string) {
   let port = config.app[name.toLowerCase()] || process.env[name];
   port = parseInt(port);
   return getPort({
     port: port
   }).then(function(result) {
     if (result != port) {
       console.log(`${name}: ${port} was taken`);
     }
     process.env[name] = result;
   });
 }
开发者ID:agneta,项目名称:platform,代码行数:12,代码来源:index.ts

示例5: CreateMockHttpsServer

 public static async CreateMockHttpsServer(): Promise<MockHttpsServer> {
     let port = await getPort();
     let server = new ServerMock(null,
         {
             host: "localhost",
             port: port,
             key: await fs.readFile("test/unitTests/testAssets/private.pem"),
             cert: await fs.readFile("test/unitTests/testAssets/public.pem")
         });
 
     return new MockHttpsServer(server, `https://localhost:${port}`);
 }
开发者ID:gregg-miskelly,项目名称:omnisharp-vscode,代码行数:12,代码来源:MockHttpsServer.ts

示例6: async

	return async (): Promise<TestServer> => {
		const port = await getPort();
		const server = http.createServer(fn) as TestServer;

		server.host = host;
		server.port = port;
		server.url = `http://${host}:${port}`;
		server.protocol = 'http';
		server.listen(port);
		server.close = pify(server.close);

		return server;
	};
开发者ID:sindresorhus,项目名称:pageres,代码行数:13,代码来源:_server.ts

示例7: createServer

export function createServer () {
    return getPort().then(port => {
        const s = http.createServer((req, resp) => s.emit(req.url, req, resp));

        s.host = host;
        s.port = port;
        s.url = `http://${host}:${port}`;
        s.protocol = 'http';

        s.listen = pify(s.listen, Promise);
        s.close = pify(s.close, Promise);

        return s;
    });
};
开发者ID:cyounkins,项目名称:typed-got,代码行数:15,代码来源:server.ts

示例8: getPort

 async getPort() {
   if (!this.options.lsp.detach) {
     return await getPort();
   }
   return TS_LANG_DETACH_PORT;
 }
开发者ID:elastic,项目名称:kibana,代码行数:6,代码来源:ts_launcher.ts


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