Socket
Socket
Sign inDemoInstall

browser-sync-middleware-spa

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-sync-middleware-spa

A single page application middleware for the BrowserSync server


Version published
Maintainers
1
Created
Source

Build Status Coverage Status

browser-sync-middleware-spa

A single page application middleware for the BrowserSync server.

Parameters

urlPathRegex

This must be a regular expression. It will be matched against the req.originalUrl value. If the URL matches then the provided HTML file will be served.

htmlFilePath

This must be an absolute path the your web application's main (index.html) file. This file will be served whenever the given urlPathRegex matches the req.originalUrl

Usage

  var browserSync     = require('browser-sync').create();
  var browserSyncSpa  = require('browser-sync-middleware-spa');
  var baseDir         = __dirname + '/_public/index.html';

  browserSync.init({
    server: {
      baseDir: __
      middleware: [
        browserSyncSpa(/^[^\.]+$/, baseDir),
      ]
    },
  };

Keywords

FAQs

Package last updated on 04 Jan 2016

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc