Skip to content

Repository files navigation

Web-Server-Here

CI npm version License: MIT Platform: Windows Node.js 18+

Start and stop local static web servers directly from Windows File Explorer.

Context Menu of Web-Server-Here

Context Menu of Web-Server-Here

Windows File Explorer context menu items for quickly serving a folder with a local static web server.

It adds a Web-Server-Here context menu group for folders and folder backgrounds, with these actions:

  • Start Server
  • Stop Server
  • Stop all Servers

The server is provided by the open source http-server package. This project only wires it into Explorer, tracks the processes it starts, and stops those tracked processes later.

At a Glance

Starts servers from Explorer Right-click a folder or folder background and choose Web-Server-Here > Start Server.
Uses free ports Multiple folders can be served at the same time.
Local only Servers bind to 127.0.0.1.
No admin required Context menu entries are installed per user under HKCU\Software\Classes.
No custom web server Static serving is delegated to http-server.

Requirements

  • Windows
  • Node.js 18 or newer
  • Windows Script Host (wscript.exe)
  • Windows PowerShell (powershell.exe)

This project is Windows-only. The CLI exits with an error on any other platform, and the npm postinstall hook skips Explorer context-menu installation outside Windows.

Quick Start

npm install --global web-server-here

For global package installations on Windows, the Explorer context menu is installed automatically.

If you want to install the package without installing the context menu items, execute:

$env:WEB_SERVER_HERE_NO_CONTEXT_MENU = "1"
npm install --global web-server-here

Then install the context menu later:

web-server-here install

Then right-click a folder in File Explorer and choose Web-Server-Here > Start Server.

Explorer actions show short Windows notifications when servers are started or stopped. Notifications are sent with node-notifier and use the app id rent-a-developer.WebServerHere.

To disable the notifications, set set WEB_SERVER_HERE_NO_NOTIFICATIONS to 1 as a user environment variable and restart Explorer or sign in again.

Uninstall

Run both commands:

web-server-here uninstall
npm uninstall --global web-server-here

The manual web-server-here uninstall step is needed because npm v7 and newer do not run uninstall lifecycle scripts. The uninstall command stops servers started by this tool and removes the Explorer context menu entries.

Usage

From File Explorer

Right-click a folder, open Web-Server-Here, and choose Start Server.

You can also right-click the empty background area inside an open folder, open Web-Server-Here, and choose Start Server to serve that current folder.

The tool starts a local static web server bound to 127.0.0.1, chooses a free port automatically, and opens the site in your default browser. You can start servers for multiple folders at the same time.

Use Stop Server on a folder or folder background to stop the server tracked for that folder.

Use Stop all Servers to stop every server tracked by this tool.

From the CLI

web-server-here install
web-server-here uninstall
web-server-here start --folder <folder> [--open-browser]
web-server-here stop --folder <folder>
web-server-here stop-all
web-server-here list

Notes

  • Context menu entries are installed per user under HKCU\Software\Classes, so admin rights are not required.
  • The context menu items are installed for folders and for the empty background area inside folders.
  • Explorer context menu items launch the CLI through a small wscript.exe helper to avoid flashing a console window.
  • Running servers are tracked in %LOCALAPPDATA%\Web-Server-Here\servers.json.
  • Windows PowerShell is used to verify a tracked server process command line before stopping it.
  • web-server-here install registers HKCU\Software\Classes\AppUserModelId\rent-a-developer.WebServerHere for Windows toast notifications.
  • Toast notifications are shown by a detached helper process, so Explorer actions do not wait for the toast to close.
  • Servers bind to 127.0.0.1 only.
  • The tool stops only server processes it has tracked.
  • It does not install a tray app, background service, COM shell extension, HTTPS support, or custom web server.
  • Context menu icons are included in the package. See THIRD_PARTY_NOTICES.md for attribution.

Local Testing Before Publishing

You can test the package locally without publishing it to npmjs.com.

From the project folder:

npm run local:test

That installs dependencies, runs tests, removes any existing global install, installs this checkout globally, and runs the same postinstall hook that a published global install would run.

Useful local development scripts:

npm run local:cleanup       # uninstall context menu entries and remove the global package
npm run local:install       # install this checkout globally
npm run local:reinstall     # cleanup, then install this checkout globally
npm run local:refresh-menu  # recreate only the Explorer context menu entries
npm run local:test          # npm ci, tests, cleanup, global install

To force-refresh the Explorer menu after changing registry code or icon files:

npm run local:refresh-menu

Then test the CLI:

web-server-here start --folder "C:\path\to\some\folder" --open-browser
web-server-here list
web-server-here stop --folder "C:\path\to\some\folder"

And test Explorer:

  1. Create a folder with an index.html file.
  2. Right-click the folder and use Web-Server-Here > Start Server.
  3. Right-click inside the empty background area of an open folder and use Web-Server-Here > Start Server.
  4. Use Stop Server or Stop all Servers to clean up.

For a closer package-install test, run:

npm pack
npm install --global .\web-server-here-0.1.0.tgz

Clean up after local testing:

npm run local:cleanup

Maintainer Release

CI runs on pushes and pull requests.

Publishing runs when a version tag matching v* is pushed and the tagged commit is contained in origin/main.

Example release:

npm version patch
git push origin main --follow-tags

License

Released under the MIT License. © 2026 David Liebeherr.

Author

David Liebeherr — rent-a-developer 📧 info@rent-a-developer.de

If this library saves you time, a ⭐ on GitHub is appreciated!

About

Windows File Explorer context menu items for starting and stopping local static web servers.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages