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

Add API routes #11

Open
lucacasonato opened this issue Oct 1, 2020 · 0 comments
Open

Add API routes #11

lucacasonato opened this issue Oct 1, 2020 · 0 comments
Labels
feat A new feature or addition

Comments

@lucacasonato
Copy link
Owner

The user should be able to add routes to pages/api that should be treated as server side API endpoints rather than HTML pages. The signature for an API route would look something like this:

// pages/api/redirect.ts

export default async (req: Request): Promise<Response> => {
  return Response.redirect(req.headers.get("X-Redirect-To"), 307); 
}
@lucacasonato lucacasonato added the feat A new feature or addition label Oct 1, 2020
RoXuS added a commit to RoXuS/dext.ts that referenced this issue Jan 28, 2021
RoXuS added a commit to RoXuS/dext.ts that referenced this issue Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat A new feature or addition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant