@lexho111/webserver.js
v0.0.11
Published
My custom webserver module
Maintainers
Readme
webserver.js
install
npm install @lexh111/webserver.jsimport app from "@lexho111/webserver.js";
app.start();customize style from browser
- select a style from the settings menu in the browser
login
- Username: testuser
- Password: test
configure and customize from Node.js project
You can specify a port and your own config and styles file.
- webserver configuration: config.json
- website content: content.json
import app from "@lexho111/webserver.js";
const configPath = "./config.json";
const stylesheetPath = "./styles.css";
const options = {
port: 8080,
configPath: configPath,
style: stylesheetPath
};
app.start(options);config.json
{
"websitetitle": "My Awesome New Website",
"build": "release",
"enableModules": true
}you can set properties via options
import app from "@lexho111/webserver.js";
const options = {
port: 8080,
websitetitle: "My Awesome New Website",
contentPath: "my-website-content.json",
style: "div { color: darkgray; }",
stylePath: "customstyles.css",
};
app.start(options);or like this
import app from "@lexho111/webserver.js";
const options = { port: 8080 };
app.setWebsiteTitle("My Awesome New Website 3");
app.setLanguage("en");
app.setStyle("div { color: darkgray; }");
app.setStylePath("customstyles.css");
app.start(options);