MCPcopy
hub / github.com/ampproject/amphtml / doServe

Function doServe

build-system/tasks/serve.js:216–226  ·  view source on GitHub ↗

* Starts a webserver at the repository root to serve built files. * @param {boolean=} lazyBuild * @return {Promise }

(lazyBuild = false)

Source from the content-addressed store, hash-verified

214 * @return {Promise<void>}
215 */
216async function doServe(lazyBuild = false) {
217 createCtrlcHandler('serve');
218 const watchFunc = async () => {
219 await restartServer();
220 };
221 watch(serverFiles).on('change', debounce(watchFunc, watchDebounceDelay));
222 await startServer({}, {lazyBuild}, {});
223 if (lazyBuild) {
224 await performPreBuildSteps();
225 }
226}
227
228module.exports = {
229 serve,

Callers 2

serveFunction · 0.85
defaultTaskFunction · 0.85

Calls 4

startServerFunction · 0.85
performPreBuildStepsFunction · 0.85
debounceFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected