xmlweb ·

Xmlweb is a web server designed based on the state machine theory. Before you learn to use the framework, make sure you are familiar with the xmlplus framework.
If having installed the NPM client, you can install xmlweb with NPM.
$ npm install xmlweb
Note, xmlweb requires node v7.0.0 or higher for ES2015 and async function support.
You can test the example with http://localhost
.
let xmlweb = require("xmlweb");
xmlweb("xp", function (xp, $_) {
$_().imports({
Index: {
xml: "<i:HTTP xmlns:i='//xmlweb'>\
<Hello id='hello'/>\
</i:HTTP>"
},
Hello: {
fun: function (sys, items, opts) {
this.on("enter", (e, d) => {
d.res.setHeader("Content-Type", "text/html");
d.res.end("hello, world");
});
}
}
});
}).startup("//xp/Index");
Visit https://xmlplus.cn/xmlweb for more information.