New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-spa-router

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-spa-router - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

21

index.js

@@ -36,19 +36,16 @@ /*!

return function(req, res, next) {
if (req.url === '/') {
if (req.xhr || req.method !== 'GET' || req.url === '/' || options.staticPaths.test(req.url)) {
return next();
}
if (!req.xhr && !options.staticPaths.test(req.url)) {
var routes = app.routes[req.method.toLowerCase()];
for (var i = 0, l = routes.length; i < l; i++) {
if (routes[i].regexp.test(req.url) || options.extraRoutes.test(req.url)) {
req.url = '/';
return next();
}
var routes = app.routes.get;
for (var i = 0, l = routes.length; i < l; i++) {
if (routes[i].regexp.test(req.url) || options.extraRoutes.test(req.url)) {
req.url = '/';
return next();
}
options.noRoute(req, res, next);
} else {
next();
}
options.noRoute(req, res, next);
}
}
{
"name": "express-spa-router",
"version": "0.0.1",
"version": "0.0.2",
"description": "Express middleware for single page app routing",

@@ -5,0 +5,0 @@ "main": "index.js",

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