Node web static files server with built in compression support.
npm i hangersteak
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!