
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
hserver-static
Advanced tools
a hserver static file server middleware
'use strict';
const Hserver = require('hserver');
const Hstatic = require('hserver-static');
const port = 8081;
const app = new Hserver();
// logger
app.use(function (next) {
const start = new Date;
this.res.once('finish', () => {
const ms = new Date - start;
console.log('%s %s %s - time:%s', this.status, this.method, this.url, ms);
});
next();
});
// static middleware
app.use(Hstatic({
// 定义访问路径前缀
// default ''
router: '/',
// 定义根文件目录
// default '.'
root: 'www',
// 定义index文件
// default 'index.html'
index: 'index.html',
// 允许访问method ['GET', 'POST', 'HEAD', 'DELETE', 'PUT']
// default ['GET', 'HEAD']
method: ['GET', 'HEAD'],
// 是否启用文件gzip压缩 Array|true|false
// ['deflate', 'gzip']
// 为true时默认为['deflate', 'gzip']
// 为false时,关闭gzip压缩
// default false
zip: true,
// 缓存时间 time(s)|true|0
// 为true时,默认缓存时间为7200s
// 为0时不缓存
// default 0
cache: 7200,
// etag true|false
// default false
etag: true
}));
app.listen(port);
console.log(`Server is running at http://127.0.0.1:${port}/`);
FAQs
a hserver static file server middleware
The npm package hserver-static receives a total of 2 weekly downloads. As such, hserver-static popularity was classified as not popular.
We found that hserver-static demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.