Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Upgrade node-file-router from 0.6.0 to 0.7.0 #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Danilqa
Copy link
Owner

@Danilqa Danilqa commented Feb 20, 2025

snyk-top-banner

Snyk has created this PR to upgrade node-file-router from 0.6.0 to 0.7.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 1 version ahead of your current version.

  • The recommended version was released a month ago.

Release notes
Package name: node-file-router
  • 0.7.0 - 2025-01-25

    What's new

    Features

    Now, node-file-router supports classes. The main requirement is that it should be the default export.

    export default class Resource {
    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:

    class SomeResource {
    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:

    import type { NextFunction } from 'node-file-router';

    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

from node-file-router GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

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:

Snyk has created this PR to upgrade node-file-router from 0.6.0 to 0.7.0.

See this package in npm:
node-file-router

See this project in Snyk:
https://app.snyk.io/org/danilqa/project/5d7da9b3-d0d7-474d-8ff4-b86b3409bfab?utm_source=github&utm_medium=referral&page=upgrade-pr
Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
node-file-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 20, 2025 2:17am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants