Skip to content

Instantly share code, notes, and snippets.

@chasyumen
Last active October 12, 2021 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasyumen/b96573602863354cedb2df963bbff425 to your computer and use it in GitHub Desktop.
Save chasyumen/b96573602863354cedb2df963bbff425 to your computer and use it in GitHub Desktop.
lite-web-server example code
const LWS = require("lite-web-server");
const server = LWS.WebServer({
port: 3000,
dir: "./public", //create /public directory (folder) and put files in that directory.
serveindex: false, //to keep your files safe, turn off this when you are not using this.
errordocument: {
//_404: "custom 404 html page path",
//_405: "custom 405 html page path",
}
});
server.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment