New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ogginger/server

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ogginger/server

A quick setup api server.

latest
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

Server

  • Create a route member that has type any and is assigned to a function that returns an object that contains the routes and their corresponding methods.
class myServer extends Server {
  public state: any = function() {
    return {
      "get": {
        "/": function( request: any, response: any ) {
          response.send("Hello World!");
        }
      }
    };
  }
}
  • Instantiate the server with the port you want it to listen on.
let server = new myServer(8000);
  • Call the asynchronous initialize method to setup the server after instantiating it.
await server.initialize();

FAQs

Package last updated on 30 Jan 2024

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