Gathering detailed insights and metrics for koa2-connect-history-api-fallback
Gathering detailed insights and metrics for koa2-connect-history-api-fallback
Gathering detailed insights and metrics for koa2-connect-history-api-fallback
Gathering detailed insights and metrics for koa2-connect-history-api-fallback
Fallback to index.html for applications that are using the HTML 5 history API
npm install koa2-connect-history-api-fallback
Typescript
Module System
Node Version
NPM Version
TypeScript (82.66%)
JavaScript (17.34%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
47 Stars
33 Commits
6 Forks
1 Watchers
2 Branches
3 Contributors
Updated on Apr 16, 2025
Latest Version
0.1.3
Package Id
koa2-connect-history-api-fallback@0.1.3
Size
64.48 kB
NPM Version
6.14.7
Node Version
14.7.0
Published on
Sep 21, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
koa2的一个中间件,用于处理vue-router使用history模式返回index.html,让koa2支持SPA应用程序。
我只是一个搬运工,让它兼容Koa2而已。详细说明请到原作者项目库查看
bripkens作者的connect-history-api-fallback
1$ npm install --save 'koa2-connect-history-api-fallback'
在原作者的使用方法下增加了白名单选项,原作者的插件默认会将所有的请求都指向到index.html,这样可能就会导致项目内其他路由也被指向到index.html 使用方法如下:
1const Koa = require('koa'); 2const { historyApiFallback } = require('koa2-connect-history-api-fallback'); 3// 或者当你使用 ES6 语法,你可以这样 4import { historyApiFallback } from 'koa2-connect-history-api-fallback'; 5// 或者 6import historyApiFallback from 'koa2-connect-history-api-fallback'; 7 8const app = new Koa(); 9 10// handle fallback for HTML5 history API 11app.use(historyApiFallback({ whiteList: ['/api'] })); 12 13// other middlewares 14app.use(...);
1const Koa = require('koa'); 2 3// require 'koa2-connect-history-api-fallback' middleware 4const { historyApiFallback } = require('koa2-connect-history-api-fallback'); 5 6// create app 7const app = new Koa(); 8 9// use historyApiFallback 10app.use(historyApiFallback()); 11 12// other middlewares 13app.use(...); 14
Follow MIT License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/14 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
28 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More