Rendering static JSON at build time? #16206
Unanswered
RobRoseKnows
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to build an API using Next.js, but some of the data returned by my API is static, so I'd like to generate the JSON at build time rather than using the
api/
route. I've already found this discussion, but it looks like they ended up using the api route and the getInitialProps answer doesn't seem like it would let me use getStaticPaths and getStaticProps as well. My ideal use would be defining a path under pages and returning raw JSON and getting JSON (not an HTML page with JSON in it).Beta Was this translation helpful? Give feedback.
All reactions