Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
koa-simple-static
Advanced tools
Simple caching static file server for Koa 2.
Fork of koa-static-cache with simpler options:
/index.html
if availableaccept-encoding
includes gzipnpm i -S koa-simple-static
app.use(serve({
dir: process.cwd()
}))
dir: str
— directory you want to servemaxAge: ?number = 0
— cache control max age (in seconds)extraHeaders: ?Object[]
— any extra headers you wish to set for requests served by this module
[ { 'Link': '</foo.js>; rel=preload; as=script' }, { 'Set-Cookie': 'foo=bar; path=/;' } ]
import serve from 'koa-simple-static'
import { resolve } from 'path'
import Koa from 'koa'
const app = new Koa()
const port = process.env.PORT || 4444
app.use(serve({
dir: resolve(__dirname, 'public'),
extraHeaders: [ { 'X-Something-Whatever': 'foo, bar' } ]
}))
app.listen(port)
console.log(`Serving on ${port}!`)
index.html
). Now, you can have the good parts of both.require('babel-register')({
babelrc: false,
presets: [ require('babel-preset-latest-minimal') ]
})
require('./server')
babel-register
in development and compiling for
production.eslint
and flow
.zlib
and fs
(maybe with util.promisify
) instead of mz
FAQs
Simple caching static file server for Koa
The npm package koa-simple-static receives a total of 0 weekly downloads. As such, koa-simple-static popularity was classified as not popular.
We found that koa-simple-static demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.