A dependency-free server for single page apps
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ポール ウェッブ a559b36d93 Typo 1 month ago
test Initial commit 1 month ago
.eslintrc Initial commit 1 month ago
.gitignore Initial commit 1 month ago
.npmignore Initial commit 1 month ago
README.md Typo 1 month ago
here.js Initial commit 1 month ago
package.json 1.0.2 1 month ago
types.json Initial commit 1 month ago

README.md

@inc/here

A dependency-free server for single page apps

Here is a zero dependency static file server with history api fallback defaults to support rapid single page app development.

Forked from Luke Jacksonn’s Servør because I just wanted a nice file server (and, quiet). No watching, no reloads.


Features

  • 🗂 Serve static content like scripts, styles, and images from a directory
  • 🖥 Reroute all non-file requests like / or /admin to a single file
  • ⏱ Install using npx and be running in the browser in ~1 second
  • 📚 Readable source code that encourages learning and contribution

Usage

Add @inc/here as a dev dependency using npm i @inc/here -D or run directly from the Terminal:

npx here <directory> <fallback> <port> <open flag> <verbose flag>
  • <directory> path to serve static files from (defaults to current directory .)
  • <fallback> the file served for all non-file requests (defaults to index.html)
  • <port> what port you want to serve the files from (defaults to 8080)
  • <open flag> if you want here to launch the site in your default browser, pass --open (defaults to false)
  • <verbose flag> if you want logging, pass --verbose (defaults to false)

Example usage with npm scripts in a project’s package.json file:

{
  "scripts": {
    "start": "npx here www index.html 8080 --verbose"
  }
}