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

@funnyzak/http-server

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@funnyzak/http-server

a static http server

latest
Source
npmnpm
Version
0.2.3
Version published
Maintainers
1
Created
Source

js-standard-style npm license

a simple static http server

it is a simple static HTTP server node module.

Getting Started

  • With npm, run npm install @funnyzak/http-server
  • const StaticHttpServer = require('@funnyzak/http-server')

Usage

Here is an example that:

  • create a new server instance
  • start server.
const StaticHttpServer = require('@funnyzak/http-server');

const rootPath = process.cwd();
const server = new StaticHttpServer({
  host: '127.0.0.1', // host
  port: 16808, // listen port
  root: rootPath, // static root directory
  cors: true, // allow cors
  compress: true, // compress response
  cache: {
    maxAge: 3600,
    expires: true, // is set expires
    cacheControl: true, // is set cacheControl
    lastModified: true,
    etag: true
  }
});

// start server
server.serve();

// close server
setTimeout(server.dispose, 5000);

// conversion of resource path to virtual path under Root
var virtualUrl = server.parseVirtualPath(resourcePath);

Author

twitter/funnyzak
funnyzak

License

Apache-2.0 License © 2021 funnyzak

Keywords

server

FAQs

Package last updated on 20 Nov 2021

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