xmlweb

1.2.4 • Public • Published

xmlweb · Downloads Version License

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.

Installation

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.

Hello, world

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.

/xmlweb/

    Package Sidebar

    Install

    npm i xmlweb

    Weekly Downloads

    3

    Version

    1.2.4

    License

    MIT

    Unpacked Size

    79.3 kB

    Total Files

    47

    Last publish

    Collaborators

    • qudou