marocchino / koa2-history-api-callback

base 'connect-history-api-fallback'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

koa2-history-api-callback

base 'connect-history-api-fallback' for SPA

Reason

Koa v2.x don't use yield*, so'koa-connect-history-api-fallback' can't adapter for Koa v2.x .

Adapter for 'connect-history-api-fallback' for use with Koa ^2.0.0.

Solution

1.use 'koa2-history-api-callback' 2.use 'koa-convert' convert old middleware ...

Installation

$ npm install --save 'koa2-history-api-callback'

Example

const Koa = require('koa')

const historyFallback = require('koa2-history-api-callback')

app.use(historyFallback())

app.use('other middleware')

About

base 'connect-history-api-fallback'

License:MIT License


Languages

Language:JavaScript 100.0%