npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

isnode-mod-interface-http

v0.1.6

Published

ISNode HTTP interface

Downloads

1

Readme

ISNode HTTP Interface Module

Introduction

This is just a module for the ISNode Framework. To learn how to use the framework, we strongly suggest obtaining a copy of the Hello World example.

The HTTP interface module allows you to instantiate one or more HTTP or HTTPS (SSL) server interfaces. Each interface instance must be configured within the application server system configuration file and mappped to one or more routers, which are in turn mapped to one or more services.

Each instance of this interface must be bound to a free port on the system, as defined within the configuration file. Refer to the example below for how this might be configured.

There should not be any need to call any methods from this module, or interact with it in any way. It should simply operate automatically - as defined in system config.

Example

{
  ...
	"interfaces": {
    "http": {
      "http1": {
        "enabled": true,
        "ssl": false,
        "port": 80,
        "requestTimeout": 60000,
        "log": false,
        "fileUploadPath": "./tmp/",
        "maxUploadFileSizeMb": 50
      },
      "http2": {
        "enabled": true,
        "ssl": false,
        "port": 8080,
        "requestTimeout": 60000,
        "log": false,
        "fileUploadPath": "./tmp/",
        "maxUploadFileSizeMb": 50
      },
      "https": {
        "enabled": true,
        "ssl": true,
        "port": 443,
        "requestTimeout": 60000,
        "log": false,
        "fileUploadPath": "./tmp/",
        "maxUploadFileSizeMb": 50,
        "key": "./config/key.pem",
        "cert": "./config/server.crt"
      }
    }
  }
  ...
}

Methods

get()

Synchronous Function. Returns an instance of the HTTP interface by name

Input Parameters:

  1. name - (String) Name of the interface, as defined within the system configuration file

Returns: (Object) The requested instance of the HTTP module.

Code example

// The below use case assumes that you have an instance of the isnode master object

var http1 = isnode.module("http", "interface").get("http1");

/*
	There are no methods exposed by the HTTP interface instance object. You can listen for events (it is an event emitter object), or emit events against the object - but this is NOT recommended, as there should be no need to do so, and it could interfere with normal system operation.

  That said, the "server" (raw HTTP server interface) and "listening" boolean are exposed as children of the interface object, so that other interface modules can determine the state of the interface and attach to the raw HTTP socket (for instance - a WebSockets interface module).
*/