Socket
Socket
Sign inDemoInstall

browser-sync-middleware-spa

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

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
Weekly downloads
12
decreased by-95.26%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 04 Jan 2016

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc