0.2.12 • Published 2 years ago

hangersteak v0.2.12

Weekly downloads
115
License
MIT
Repository
github
Last release
2 years ago

Hangersteak

Node web static files server with built in compression support.

INSTALL

npm i hangersteak

USAGE

Vanilla NodeJS server. Will return 404 if not found, or the file using streams and correct mime type. Supports automatic 304 last modified headers.

const http = require('http')
const hangersteak = require('hangersteak')

const server = http.createServer((req, res) => {
  // Using default options
  hangersteak(req, res)

  // With options, default values shown
  hangersteak(req, res, {
    dir: '', // Start with '/' to use absolute path
    maxAge: 3600,
    indexFile: 'index.html',
    compress: false
  })
})

server.listen(3000)

MIT licensed. Enjoy!

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago