1. pushstate-server
Static file server that works with HTML5 Pushstate.
pushstate-server
Package: pushstate-server
Created by: scottcorgan
Last modified: Sat, 25 Jun 2022 02:09:26 GMT
Version: 3.1.0
License: MIT
Downloads: 14,657
Repository: https://github.com/scottcorgan/pushstate-server

Install

npm install pushstate-server
yarn add pushstate-server

pushstate-server

Static file server that works with HTML5 Pushstate.

For example, the route /some/pushstate/route will return the index.html file. But, /some/static/path/logo.png will return the logo.png static file.

Install

npm install pushstate-server --save

Usage

 var server = require('pushstate-server');

server.start({
  port: 3000,
  directory: './public'
});

or for multiple directories

 var server = require('pushstate-server');

server.start({
  port: 4200,
  directories: ['./public', './bower_components']
});

or bind to a particular host

 server.start({
  port: 4200,
  host: '192.99.100.01',
  directories: ['./public', './bower_components']
});

Global Install

npm install -g pushstate-server
usage: pushstate-server [directory] [port] [file]

API

start(options[, callback])

  • start the pushstate static file server
options
  • port
    • set the port that the server should open
    • uses process.env.PORT if not specified, and defaults to port 9000 if none is available
  • directory
    • the path to the directory where the static assets will be served
    • defaults to public
  • file
    • Custom file to serve
    • defaults to index.html

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin