[Snyk] Upgrade node-file-router from 0.6.0 to 0.8.0 #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade node-file-router from 0.6.0 to 0.8.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 2 versions ahead of your current version.
The recommended version was released 10 months ago.
Release notes
Package name: node-file-router
-
0.8.0 - 2025-02-01
-
0.7.0 - 2025-01-25
export default class Resource {
class SomeResource {
import type { NextFunction } from 'node-file-router';
- Added information about this update.
- Set the valid links for Edit this page
from node-file-router GitHub release notesWhat's new
Features
Now,
node-file-routersupports the ability to read of parsed routes. Simply get it fromonInitcallback:Full Changelog: v0.7.0...v0.8.0
What's new
Features
Now,
node-file-routersupports classes. The main requirement is that it should be the default export.get(req, res, routeParams) {
const { documentId, draftId } = routeParams;
res.end(
Requested document <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">documentId</span><span class="pl-kos">}</span></span> and his draft <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">draftId</span><span class="pl-kos">}</span></span>);}
post(req, res, routeParams) {
const { documentId, draftId } = routeParams;
res.end(
Created draft <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">draftId</span><span class="pl-kos">}</span></span> for document <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">documentId</span><span class="pl-kos">}</span></span>);}
patch(req, res, routeParams) {
// ...
}
}
Alternatively, you can export a class instance:
get(req, res, routeParams) {
// ...
}
}
export default new SomeResource();
0.6.0 - 2024-02-24
What's new
Features
Added the ability to modify or override a final result in middlewares (#41).
For example, you can now set response headers in Bun inside middlewares:
export async function useCors(req: Request, next: NextFunction<Response>) {
const res = await next();
res.headers.set('Access-Control-Allow-Methods', 'PUT, POST, OPTIONS, HEAD');
return res;
}
Documentation
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
Note
Upgrade
node-file-routerfrom0.6.0to0.8.0inexamples/published-package/package.json.Written by Cursor Bugbot for commit 68bad92. This will update automatically on new commits. Configure here.