10000 Replacing square brackets when getting page route by vkeskinen · Pull Request #99 · serverless-nextjs/serverless-next.js · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Conversation

vkeskinen
Copy link
Contributor

Next.js 9 introduced file-system based dynamic routes (https://nextjs.org/blog/next-9#dynamic-route-segments). However AWS API Gateway doesn't allow square brackets in resource's path part.

By the way, not sure how generic this is or does it have some implications in other parts of the plugin but at least it seemed to solve our problem. If there are problems I'll be happy to consider some other solution.

@edercampelo
Copy link

+1

Copy link
@GigaMax13 GigaMax13 left a comment

Choose a reason for hiding this comment

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

Well done.

@jnlsn
Copy link
jnlsn commented Aug 7, 2019

Brilliant! I got next 9 up and running on AWS because of this.

@Deadleg Deadleg mentioned this pull request Aug 12, 2019
@mattdell
Copy link
Contributor

Is there anything left to do with this PR before we can get it merged?

@mattdell
Copy link
Contributor

And would this work with nested Dynamic Routes?

e.g.

GET /api/blog/[blogId]/comments/[commentId]

@vkeskinen
Copy link
Contributor Author

And would this work with nested Dynamic Routes?

e.g.

GET /api/blog/[blogId]/comments/[commentId]

We've used the forked version now for a while and it solves the problem in our project so in that sense nothing to add from my side 😄 However our use case is very simple and I haven't tested anything else like the nesting - can do that though if it would be useful.

@danielcondemarin
Copy link
Contributor

Sorry it took me a while to look at this. I suspect there is more to do to support dynamic route segments but will merge this in considering it has been working for a few people, thanks for the PR @vkeskinen 🙏

@danielcondemarin danielcondemarin merged commit 38863e1 into serverless-nextjs:master Aug 13, 2019
@vkeskinen
Copy link
Contributor Author

No problem and thanks for the great plugin @danielcondemarin! That is my assumption as well; if you need any help let me know.

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

Successfully merging this pull request may close these issues.

6 participants
0