
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
koa-public-path-static
Advanced tools
yarn add koa-public-path-static
So, I didn't find koa static server with configurable publicPath
and ability to pass request to the next middleware, if file is not found, and wrote my own.
Say, you have the following file structure:
projectroot/assets/fox.png
projectroot/build/font.woff
projectroot/public/license.pdf
And you want that files to be accesible via urls:
https://yourawesomeproject.domain/assets/font.woff
https://yourawesomeproject.domain/assets/license.pdf
https://yourawesomeproject.domain/assets/fox.png
And, for some reasons, you use koa
, not express
...
With koa-public-path-static
it is as simple as that:
const path = require('path');
const serve = require('koa-public-path-static');
const assetsDir = path.resolve(__dirname, './assets');
const buildDir = path.resolve(__dirname, './build');
const publicDir = path.resolve(__dirname, './public');
app.use(serve(assetsDir));
app.use(serve({
path: buildDir,
publicPath: '/assets'
}));
app.use(serve({
path: publicDir,
publicPath: '/assets'
}));
FAQs
koa static server with configurable publickPath
We found that koa-public-path-static demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.