Skip to content

fix: fixes specifying / as a path for v2 api functions #6045

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

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

lukasholzer
Copy link
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes https://github.com/netlify/pod-dev-foundations/issues/597

Fixes an issue where specifying the following config did not work:

import type { Context, Config } from '@netlify/functions';

export default (req: Request, context: Context) => {
  return new Response(`Hello World`, { status: 200 });
};

export const config: Config = {
  path: '/', // <-- did not work in the CLI
};

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@lukasholzer lukasholzer requested a review from a team as a code owner October 9, 2023 14:27
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

📊 Benchmark results

Comparing with 8183fd0

  • Dependency count: 1,386 (no change)
  • Package size: 389 MB ⬇️ 0.00% decrease vs. 8183fd0

Skn0tt
Skn0tt previously approved these changes Oct 9, 2023
@lukasholzer
Copy link
Contributor Author

lukasholzer commented Oct 9, 2023

I've just seen the same issue is in production @Skn0tt do you know where to fix that?

cc @eduardoboucas

@Skn0tt
Copy link
Contributor

Skn0tt commented Oct 10, 2023

I noticed that we were also not matching / on the /* route. The fix in this PR also fixed that, so I added my test onto this PR: cbbb2c2

@lukasholzer lukasholzer enabled auto-merge (squash) October 10, 2023 07:17
@lukasholzer lukasholzer merged commit 970b3df into main Oct 10, 2023
@lukasholzer lukasholzer deleted the fix/functions-v2-api-path-root branch October 10, 2023 07:26
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