Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Small, local HTTP server for static files.
npx servitsy [directory] [options]
[!NOTE] servitsy is a command-line tool, published as a npm package. It requires Node.js version 18 or higher, or a compatible runtime like Deno or Bun.
# Running with Bun
bunx servitsy
# Running with Deno (will prompt for read access)
deno run --allow-net --allow-sys npm:servitsy
Calling servitsy without options will:
http://localhost:8080
(listening on hostname 0.0.0.0
);8080
is not available;index.html
files for folders, and .html
files when the extension was omitted in the URL;You can configure servitsy's behavior with options. For example:
# Serve current folder on port 3000, with CORS headers
npx servitsy -p 3000 --cors
# Serve 'dist' folder and disable directory listings
npx servitsy dist --no-list
npx servitsy --help
for an overview of available options.See doc/changelog.md for the release history.
This package is licensed under the MIT license.
[!WARNING] servitsy is not designed for production. There are safer and faster tools to serve a folder of static HTML to the public. See Apache, Nginx,
@fastify/static
, etc.
For local testing, here are a few established alternatives you may prefer, with their respective size:
Package | Version | Dependencies | Installed size† |
---|---|---|---|
servitsy | 0.5.0 | 0 | 104 kB |
servor | 4.0.2 | 0 | 144 kB |
sirv-cli | 3.0.0 | 12 | 396 kB |
serve | 14.2.4 | 87 | 7.5 MB |
http-server | 14.1.1 | 52 | 9.4 MB |
If size and dependency count is not a concern and you want something stable and battle-tested, I recommend serve and http-server.
Otherwise servitsy, sirv-cli or servor might work for you.
† Installed size is the uncompressed size of the package and its dependencies (as reported by du
on macOS; exact size may depend on the OS and/or filesystem).
FAQs
Small, local HTTP server for static files
We found that servitsy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.