You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

basic-node-server

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basic-node-server

Basic node server for everyone.

1.0.16
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

basic-node-server

Basic node server for everyone.

Basic node server simply hosts and serves files from the current project directory through HTTP. If no path is given, or if the path ends with '/' or '', it will serve the index.html file in the directory.

Installation

npm install basic-node-server

Usage

Then, you can run it from your project directory:

npx bns [port] 404=[404.page]

The [port] argument is optional. If no port is given, it will default to 3000.

For example, if you want to serve the current directory on port 8080, you would run:

npx bns 8080

If you need to setup additional 404 page you can do so by:

npx bns 8080 404=your404page.html

If you need to set response header to have no-caching settings:

npx bns 8080 404=your404page.html no-cache=true

FAQs

Package last updated on 30 Apr 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.