-
-
Save afatihyavasi/521e430dfb02a442015f873b3c405fb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function getStaticProps({ params }) { | |
const response = await fetch( | |
`https://nextjs-blog-afatihyavasi.herokuapp.com/posts?slug=${params.slug}` | |
); | |
const data = await response.json(); | |
const content = await serialize(data[0].content); | |
return { | |
props: { | |
data: data[0], | |
content, | |
}, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment