MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / run

Function run

lib/commands/serve.js:100–122  ·  view source on GitHub ↗
(commandOptions)

Source from the content-addressed store, hash-verified

98 },
99
100 async run(commandOptions) {
101 if (this.isViteProject) {
102 return Promise.reject(
103 new SilentError(
104 'The `serve` command is not supported in Vite-based projects. Please use the `start` script from package.json.'
105 )
106 );
107 }
108
109 commandOptions.liveReloadHost = commandOptions.liveReloadHost || commandOptions.host;
110
111 let wrappedCommandOptions = await this._checkOrGetPort(commandOptions);
112 if (wrappedCommandOptions.proxy) {
113 if (!/^(http:|https:)/.test(wrappedCommandOptions.proxy)) {
114 let message = `You need to include a protocol with the proxy URL.${EOL}Try --proxy http://${wrappedCommandOptions.proxy}`;
115
116 return Promise.reject(new SilentError(message));
117 }
118 }
119
120 await Win.checkIfSymlinksNeedToBeEnabled(this.ui);
121 await this.runTask('Serve', commandOptions);
122 },
123
124 async _checkOrGetPort(commandOptions) {
125 let portOptions = { port: commandOptions.port || DEFAULT_PORT, host: commandOptions.host };

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected