angular/packages/examples/forms/start-server.js
Paul Gschwendtner 642d009501 refactor: switch packages/examples to ESM-compatible http server (#48521)
* Switches all examples to use dev-infra's canonical ESM-compatible
  `http_server`.
* Uses ESBuild for bundling ESM into a single file, compared to having
  to load hundreds of individual ESM files in the browser (potential
  source of flakiness & slowness).

PR Close #48521
2022-12-19 19:50:44 +00:00

17 lines
550 B
JavaScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const protractorUtils = require('@bazel/protractor/protractor-utils');
const protractor = require('protractor');
module.exports = async function(config) {
const {port} = await protractorUtils.runServer(config.workspace, config.server, '--port', []);
const serverUrl = `http://localhost:${port}`;
protractor.browser.baseUrl = serverUrl;
};