Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

awebserver

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awebserver

this is a simple library to create a web server

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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});

FAQs

Package last updated on 07 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc