Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

docs: add server routes documentation #4174

Merged
merged 18 commits into from
Apr 9, 2022
Merged

Conversation

Diizzayy
Copy link
Member

@Diizzayy Diizzayy commented Apr 7, 2022

  • πŸ“– 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

This PR updates the documentation to detail possible usage and use cases of API Routes

πŸ“ Checklist

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

@netlify
Copy link

netlify bot commented Apr 7, 2022

βœ… Deploy Preview for nuxt3-docs ready!

Name Link
πŸ”¨ Latest commit 30a5c3c
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62516f8b997dbe0008da5e33
😎 Deploy Preview https://deploy-preview-4174--nuxt3-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

docs/content/2.guide/2.features/9.api-routes.md Outdated Show resolved Hide resolved
```ts [server/api/node.ts]
import type { IncomingMessage, ServerResponse } from 'http'

export default async (req: IncomingMessage, res: ServerResponse) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not advocate this or if doing, mentioning is mainly for supporting legacy middleware and advanced use. h3 is dropping node dependency progressively (unjs/h3#73)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taking that into consideration, do you think the best forward thinking resolve would just be to avoid mentioning it altogether?

docs/content/2.guide/2.features/9.api-routes.md Outdated Show resolved Hide resolved
docs/content/2.guide/2.features/9.api-routes.md Outdated Show resolved Hide resolved
docs/content/2.guide/2.features/9.api-routes.md Outdated Show resolved Hide resolved
docs/content/2.guide/2.features/9.api-routes.md Outdated Show resolved Hide resolved
docs/content/2.guide/2.features/9.api-routes.md Outdated Show resolved Hide resolved
@pi0 pi0 added documentation Improvements or additions to documentation changes-requested labels Apr 7, 2022
Co-authored-by: pooya parsa <pyapar@gmail.com>
@Rigo-m
Copy link
Contributor

Rigo-m commented Apr 7, 2022

Should we migrate from using h3's defineHandler?

@pi0
Copy link
Member

pi0 commented Apr 7, 2022

Should we migrate from using h3's defineHandler?

Definitely! (marking it as deprecated soon)

@Rigo-m
Copy link
Contributor

Rigo-m commented Apr 7, 2022

It would be really helpful from a formative standpoint to understand the whys behind moving from defineHandler to the new h3 method :)

@pi0
Copy link
Member

pi0 commented Apr 7, 2022

unjs/h3#73

@pi0 pi0 changed the title docs: add API Routes documentation docs: add server routes documentation Apr 9, 2022
@pi0 pi0 merged commit 529712d into nuxt:main Apr 9, 2022
@pi0
Copy link
Member

pi0 commented Apr 9, 2022

Thanks for help @Diizzayy πŸ‘πŸΌ

@Diizzayy Diizzayy deleted the docs/api-routes branch April 9, 2022 11:38
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants