New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

koa-push

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-push

Koa middleware for handling client-side pushstate routes.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Koa Push

Build Status

Koa middleware for handling client-side pushstate routes. By default, a push state request is any GET request that has no file extension and doesn't begin with /api/.

Install

npm install koa-push

Usage

import koaPushState from 'koa-push';

app.use(koaPushState('/path/to/index.html'));

Alternatively, you can pass your own check to determine if the request should be handled by the push state middleware:

import koaPushState, { isPushStateRouteDefault } from 'koa-push';

app.use(
  koaPushState(
    '/path/to/index.html',
    context =>
      isPushStateRouteDefault(context) ||
      context.request.path.startsWith('/routes/')
  )
);

Keywords

koa

FAQs

Package last updated on 08 Nov 2019

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