Skip to content

qudou/xmlweb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A tiny http server based on xmlplus.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published