0.0.4 • Published 3 years ago

node_struct v0.0.4

Weekly downloads
29
License
-
Repository
-
Last release
3 years ago

Basic Example

const { Application } = require('node_struct');

const app = new Application();

app.route('/msg/', [middleware], hello_world);
app.serve({ port:8080 });

function middleware({ req }) {
    console.log(`Incoming ${req.method}: ${req.url}`)
}

// GoTo : http://localhost:8080/msg/hello/world
function hello_world({ res }) {
    res.write('Hello, World!');
    res.end();
}

console.log(Object.keys(app.staticRouter));
0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago