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

docs(vercel): add note about top level api/ directory #1386

Merged
merged 4 commits into from
Jul 6, 2023

Conversation

rieger-jared
Copy link
Contributor

@rieger-jared rieger-jared commented Jul 3, 2023

After following the initial project scaffolded via the command npx giget@latest nitro nitro-app I found that after deploying to vercel via vercel command my routes were not at the expected place of domian.com/api/hello/.

I added this documentation to hopefully help future developers wishing to deploy to vercel not waste time understanding the mapping of routes.

I found the solution via this GitHub discussion

#233

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@nuxt-studio
Copy link
Contributor

nuxt-studio bot commented Jul 3, 2023

Live Preview ready!

Name Edit Preview Latest Commit
nitro Edit on Studio ↗︎ View Live Preview 39e68bc

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Merging #1386 (39e68bc) into main (f0d0d91) will decrease coverage by 0.36%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1386      +/-   ##
==========================================
- Coverage   76.73%   76.37%   -0.36%     
==========================================
  Files          71       71              
  Lines        7273     7273              
  Branches      727      721       -6     
==========================================
- Hits         5581     5555      -26     
- Misses       1691     1717      +26     
  Partials        1        1              

see 2 files with indirect coverage changes

@Hebilicious Hebilicious added the documentation Improvements or additions to documentation label Jul 3, 2023
@Hebilicious
Copy link
Contributor

This is welcomed, altough this is mentioned in the docs already here: https://nitro.unjs.io/guide/routing, it's easy to miss.

@rieger-jared
Copy link
Contributor Author

This is welcomed, altough this is mentioned in the docs already here: https://nitro.unjs.io/guide/routing, it's easy to miss.

Thanks! I was a little confused by this page. I'm very new to the project so I assume this might be obvious for more seasoned nuxt devs who are familiar with nitro.

Are you talking about this quote from the page you linked?

Due to some providers like Vercel using top-level api/ directory as a feature, Nitro also supports routes/api/ to create API routes.

Copy link
Contributor

That's the one yes !

@rieger-jared
Copy link
Contributor Author

Ok, perhaps then I'll add to the original quote.

@rieger-jared
Copy link
Contributor Author

@Hebilicious I reworded the original documentation. What do you think?

@Hebilicious
Copy link
Contributor

@rieger-jared I liked your initial idea of adding more instructions within Vercel, so I added a section there. Does this looks more comprehensible to you ?

@rieger-jared
Copy link
Contributor Author

rieger-jared commented Jul 5, 2023

Yeah, looks good to me! I think it's also good that we include it in the deployment section as I'm sure most people won't hold the link between the doc sections. Thank you for adding that back in!

@Hebilicious Hebilicious added the ready label Jul 5, 2023 — with Volta.net
@Hebilicious Hebilicious requested review from pi0 and atinux July 5, 2023 07:52
@pi0 pi0 changed the title docs: Add documentation around routing for vercel docs(vercel): add note about top level api/ directory Jul 6, 2023
@pi0 pi0 merged commit 6bc50b2 into nitrojs:main Jul 6, 2023
@rieger-jared
Copy link
Contributor Author

❤️

@pi0 pi0 mentioned this pull request Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants