3.0.0 • Published 8 months ago

@hatsy/serve-static v3.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
8 months ago

Static Content Handler

NPM Build Status Code Quality Coverage GitHub Project API Documentation

serveStatic()

This module contains a serveStatic() factory of request handler able to serve static content.

It is based on send and can be configured with similar options.

import { httpListener } from '@hatsy/hatsy';
import { dispatchByName, Routing } from '@hatsy/router';
import { serveStatic } from '@hatsy/serve-static';
import { createServer } from 'http';

const server = createServer(
  httpListener(
    Routing.for(
      dispatchByName({
        assets: serveStatic('static_html/assets', { extensions: ['png', 'jpeg', 'gif'] }),
      }),
    ),
  ),
);

server.listen(8080);
3.0.0

8 months ago

2.3.1

1 year ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-dev.0

4 years ago

1.6.0

4 years ago

1.0.0

4 years ago

1.0.0-dev.0

4 years ago