Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alchemist-middleware

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alchemist-middleware

Procuring static files since 1802

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

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

alchemist-middleware

npm tests coverage dependencies

Procuring static files since 1802.

Note: This project is in early development, and versioning is a little different. Read this for more details.

Why should you care?

So there are already a number of pieces of middleware intended for serving static files. The difference with alchemist is that this one is intended only for serving static files. The main difference is that when a file is not found, it throws an error rather than just passing the request on. This is because when you are serving a static site, a 404 is not recoverable, other than by an error page.

This module is a light wrapper over send, that has static-style error handling.

Installation

npm install alchemist-middleware

Usage

Alchemist's API was designed to be quite straightforward to use. Here's a quick example:

var http = require('http'),
    connect = require('connect'),
    alchemist = require('alchemist-middleware');

var app = connect().use(alchemist('public'));

http.createServer(app).listen(1111);

There are a few options you can use to configure alchemist's behavior. An example is shown below with all the options filled out as their default values:

alchemist('public', {
  etag: true,          // toggle etag generation
  hidden: false,       // toggle serving of hidden/dotfiles
  index: 'index.html', // directory index filename, string or false
  maxage: 0            // max age in ms for http cacheing
});

License & Contributing

FAQs

Package last updated on 12 Jul 2015

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