當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。