Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
pr-render-static
Advanced tools
@priestine/routing
Render Static ModuleThe pr-render-static
module allows rendering static files using @priestine/routing
.
yarn add @priestine/routing pr-render-static
It's as easy as registering a new GET route and assigning it
RenderStatic.from(/* static file directory */)
which returns an array of middleware
that will search for a file in the directory provided as the argument (this is relative to your package.json
),
set required MIME type and fire the response containing the data. If the file does not exist,
it will set status code to 404 and end the response with text/plain
Content-Type header.
import { HttpRouter } from '@priestine/routing';
import { RenderStatic } from 'pr-render-static';
const router = HttpRouter.empty()
.get(/^\/static\/.*/, RenderStatic.from('static'))
;
It is recommended to include RenderStatic
as the very last item in your router in case static files are not rendered
on a specific route (e.g. when you set up RenderStatic
for /^.*$/
) so that it is referred to as the last resort.
FAQs
@priestine/routing module for rendering static files
We found that pr-render-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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.