Do we have basepath support in next.js?
similar to basename in react router 4 (https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string).
This is essential if we deploy the next.js application in particular path of the domain like
www.myexistingdomain.com/mynextjsapp (mynextjsapp is the path for next.js application)
Any suggestions or existing configurations for this scenario?
See also this issue, it's unfortunately still not solved: https://github.com/zeit/next.js/issues/257
Closing this because of #257
This doesn't seem like it was solved with the Zones feature that #257 concludes with. I need a single next.js app to live at ourdomain.com/admin, so that requests to /admin => / in the app. Am I missing a solution to this?
I'm assuming you're using something like nginx to proxy pass.
Add assetPrefix: "/admin" to next.config.js and then when you make a NextLink do the following: <NextLink href={href} as={"/admin" + href}>{children}</NextLink>
If something needs more explanation google is your friend.
Applications can have 100s of links in them. It's silly to have to set the "as" property over and over to the same href value plus some prefix.
I believe this is the same issue I ran across. I posted a potential work around in the comments at: https://github.com/zeit/next.js/issues/257#issuecomment-445509191 Note: It did require running a custom express server.
Most helpful comment
Applications can have 100s of links in them. It's silly to have to set the "as" property over and over to the same href value plus some prefix.