
Security News
Next.js moves to scheduled security releases
Vercel is formalizing a monthly release program for Next.js. The change follows React2Shell and a sharp rise in AI-assisted vulnerability discovery.
serve-content
Advanced tools
serve-content based on file name extensions and serving jade and stylus files
All in serve-static documentation is working here. But serve-content add some mandatory parameters to indicate which are the allowed extensions:
allowedExts is a white list of extensions names for serve.
allowAllExts is a boolean. True means that all extensions are allowed. It can be used with excludeExts.
allowedExts is a black list with ignorings extensions.
var connect = require('connect')
var extensionServeStatic = require('serve-content')
var app = connect()
// Serve up all folders for images
app.use(serveContent('/', {
extensions: ['html', 'htm'],
index: 'index.html',
allowedExts: ['', 'html', 'htm', 'png', 'jpg', 'jpeg', 'gif']
})
// Listen
app.listen(3000)
For use the serve-static extensions parameter you must include de empty string ('') in the staticExtension list (as you see in the example).
serve-content also search the extension in the mime types. If you need to add a non standard extension you can add it in the mime field
var connect = require('connect')
var extensionServeStatic = require('serve-content')
var mime = extensionServeStatic.mime;
mime.types.specialimage = 'image/special';
var app = connect()
// Serve up all folders for images
app.use(serveContent('/', {
extensions: ['html', 'htm'],
index: 'index.html',
allowedExts: ['', 'html', 'htm', 'png', 'jpg', 'jpeg', 'gif', 'specialimage']
})
// Listen
app.listen(3000)
FAQs
Serve static files based on file name extensions
The npm package serve-content receives a total of 38 weekly downloads. As such, serve-content popularity was classified as not popular.
We found that serve-content 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
Vercel is formalizing a monthly release program for Next.js. The change follows React2Shell and a sharp rise in AI-assisted vulnerability discovery.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.

Research
/Security News
4 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.