1.0.4 • Published 4 years ago

awebserver v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

A WEB SERVER

A simple javascript based web server that works with OLD versions of node (v0.6.14)

A hello world example

This is a simple example that demonstrates dynamic url path parameters (People like that stuff)

const server = require('awebserver');

server.addRoute('/hello/{name}', 'GET', function (req, res) {
   const name = req.query.name;
   console.log(name + " says hello");
   res.response(200, "hello " + name + "\n");
});

server.serve(8080);

Commands

This library exposes three basic functions.

addRoute

server.addRoute({PATH}, {METHOD}, {HANDLER FUNCTION});

addErrorHandler

server.addErrorHandler({CODE}, {HANDLER FUNCTION});

serve

server.serve({PORT}, {HTTPS OPTIONS});
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago