MCPcopy Index your code
hub / github.com/angular/angular-cli / externalServer

Function externalServer

tests/e2e/tests/i18n/setup.ts:105–120  ·  view source on GitHub ↗
(outputPath: string, baseUrl = '/')

Source from the content-addressed store, hash-verified

103 * Call .close() on the server return value to close the server.
104 */
105export async function externalServer(outputPath: string, baseUrl = '/'): Promise<ExternalServer> {
106 const app = express();
107 app.use(baseUrl, express.static(resolve(outputPath)));
108
109 return new Promise((resolve) => {
110 const server = app.listen(0, 'localhost', () => {
111 const { port } = server.address() as AddressInfo;
112
113 resolve({
114 server,
115 port,
116 url: `http://localhost:${port}${baseUrl}`,
117 });
118 });
119 });
120}
121
122export const baseHrefs: { [l: string]: string } = {
123 'en-US': '/en/',

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected