Gathering detailed insights and metrics for static-koa-router
Gathering detailed insights and metrics for static-koa-router
Gathering detailed insights and metrics for static-koa-router
Gathering detailed insights and metrics for static-koa-router
npm install static-koa-router
Typescript
Module System
Node Version
NPM Version
65.9
Supply Chain
92.7
Quality
74.1
Maintenance
100
Vulnerability
100
License
TypeScript (99.3%)
HTML (0.7%)
Total Downloads
25,953
Last Day
2
Last Week
59
Last Month
416
Last Year
7,731
1 Stars
24 Commits
1 Forks
3 Watching
16 Branches
1 Contributors
Latest Version
1.0.3
Package Id
static-koa-router@1.0.3
Size
3.65 kB
NPM Version
6.8.0
Node Version
10.7.0
Publised On
01 Mar 2019
Cumulative downloads
Total Downloads
Last day
-91.7%
2
Compared to previous day
Last week
-53.5%
59
Compared to previous week
Last month
-20.5%
416
Compared to previous month
Last year
-5.9%
7,731
Compared to previous year
npm i static-koa-router
yarn add static-koa-router
Serve(dirPath: string, router: Router, options?: Options)
You simply need to pass the dir path at the first parameter, the router instance (koa-router) at the second parameter and optionaly the options at third parameter.
maxage
Browser cache max-age in milliseconds. defaults to 0hidden
Allow transfer of hidden files. defaults to falseindex
Default file name, defaults to 'index.html'defer
If true, serves after return next()
, allowing any downstream middleware to respond first.gzip
Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested file with .gz extension exists. defaults to true.br
Try to serve the brotli version of a file automatically when brotli is supported by a client and if the requested file with .br extension exists (note, that brotli is only accepted over https). defaults to true.extensions
Try to match extensions from passed array to search for file when no extension is sufficed in URL. First found is served. (defaults to false
)1import { Serve } from "static-koa-router"; 2import * as KoaRouter from "koa-router"; 3import * as Koa from "koa"; 4import * as Http from "http"; 5 6const app = new Koa(); 7 8const router = new KoaRouter({ 9 prefix: "/public" 10}); 11 12Serve(`${__dirname}/public`, router); 13 14app.use(router.routes()); 15 16const server = Http.createServer(app.callback()); 17 18server.listen(1337, "localhost", () => { 19 console.log("Server started"); 20});
1const { Serve } = require("static-koa-router"); 2const KoaRouter = require("koa-router"); 3const Koa = require("koa"); 4const Http = require("http"); 5 6const app = new Koa(); 7 8const router = new KoaRouter({ 9 prefix: "/public" 10}); 11 12Serve(`${__dirname}/public`, router); 13 14app.use(router.routes()); 15 16const server = Http.createServer(app.callback()); 17 18server.listen(1337, "localhost", () => { 19 console.log("Server started"); 20});
koa-static
koa-send
koa-router
MIT - Owen Calvin
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/14 approved changesets -- score normalized to 0
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
68 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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