New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

awesome-static

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

awesome-static

Koa static file serving middleware base on [`koa-send`](https://github.com/koajs/send).

  • 1.4.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

Awesome-Static Build Status npm TypeScript

Koa static file serving middleware base on koa-send.

Feature

Some new features compared to koa-static.

  • :monkey:Set the route map to static file directory
  • :sunny:More than GET and HEAD
  • :coffee:Develop with Typescript

Installation

npm
npm install awesome-static
yarn
yarn add awesome-static

Usage

const Koa = require('koa');
const static = require('awesome-static');
const app = new Koa();

app.use(
  static('public', {
    allowMethods: ['GET', 'HEAD', 'POST'],
    route: 'hello',
  }),
);

app.listen(8080);

See /example.

API

AwesomeStatic(root, options);
  • root root directory string. nothing above this root directory can be served (Type: string).
  • options options object (Type:AwesomeOptions).
[Type] AwesomeOptions

Extends options from koa-static

  • route route for mapping to a static server (Type:string).
  • allowMethods HTTP method for allow access static file (Type:HTTPMethod).
[Type] HTTPMethod

GET | HEAD | POST | PUT | DELETE

License

MIT

FAQs

Package last updated on 25 Jan 2019

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