You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mellon-server

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mellon-server

A small hackable HTTP server

1.1.2
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

mellon-server

A small experimental hackable HTTP server.

Install

npm install mellon-server

Run server

npx mellon-server

Hackable

const { start_server } = require('mellon-server');

start_server({
    host: 'localhost',
    port: 8000,
    public: './public',
    base: 'https://my.base.url/service',
    registry: [
       { path: 'demo' , do: doDemo },
       { path: 'test/.*', do: './hander/demo.js', with: { myOption: 123 }}
    ]
});

function doDemo(req,res,opts) {
    res.writeHead(200);
    res.end('Hello World!');   
}

All files in the public directory will be served to the world. Directories and files can have a .meta JSON file which contains extra HTTP headers that should be added to the HTTP response.

FAQs

Package last updated on 11 Sep 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