MCPcopy Index your code
hub / github.com/11ty/dev-server / serve

Method serve

cli.js:59–77  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

57 }
58
59 async serve(options = {}) {
60 this.options = Object.assign(Cli.getDefaultOptions(), options);
61
62 this.server = EleventyDevServer.getServer("eleventy-dev-server-cli", this.options.input, {
63 // TODO allow server configuration extensions
64 showVersion: true,
65 logger: Logger,
66 domDiff: this.options.domDiff,
67
68 // CLI watches all files in the folder by default
69 // this is different from Eleventy usage!
70 watch: [ this.options.input ],
71 });
72
73 this.server.serve(this.options.port);
74
75 // TODO? send any errors here to the server too
76 // with server.sendError({ error });
77 }
78
79 close() {
80 if(this.server) {

Callers 2

cmd.jsFile · 0.45

Calls 2

getDefaultOptionsMethod · 0.80
getServerMethod · 0.80

Tested by

no test coverage detected