Skip to content

tamed-tools/hangersteak

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: '',
    maxAge: 3600,
    indexFile: 'index.html',
    compress: false
  })
})

server.listen(3000)

MIT licensed. Enjoy!

About

Node static file web server with streaming support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%