MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / restartHttpServer

Method restartHttpServer

lib/tasks/server/express-server.js:161–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159 }
160
161 restartHttpServer() {
162 if (this.serverRestartPromise) {
163 return this.serverRestartPromise.then(() => this.restartHttpServer());
164 }
165
166 this.serverRestartPromise = (async () => {
167 try {
168 await this.stopHttpServer();
169 this.invalidateCache(this.serverRoot);
170 await this.startHttpServer();
171
172 this.emit('restart');
173 this.ui.writeLine('');
174 this.ui.writeLine(chalk.green('Server restarted.'));
175 this.ui.writeLine('');
176 } catch (err) {
177 this.ui.writeError(err);
178 } finally {
179 this.serverRestartPromise = null;
180 }
181 })();
182
183 return this.serverRestartPromise;
184 }
185
186 stopHttpServer() {
187 return new Promise((resolve, reject) => {

Callers 2

constructorMethod · 0.95

Calls 5

stopHttpServerMethod · 0.95
invalidateCacheMethod · 0.95
startHttpServerMethod · 0.95
emitMethod · 0.95
thenMethod · 0.45

Tested by

no test coverage detected