Reputation: 629
I've got a Nuxt3 website which has a blog which is based on Strapi.io. So the blog posts are loaded via the API. After the website is deployed via nuxt generate
the posts which are published till the deployment work fine. (There are static folders for each blog post generated by nuxt generate
)
BUT if i publish a new post it can't not be opened like url.de/blog/new-post. As there is no folder on the server generated by nuxt of course it leads to a 404.
But how can i manage to build the folder and contents on the first call of the new post?
What i tried but it does not work:
routeRules: {
"/blog/**": { swr: true },
}
Upvotes: 1
Views: 488
Reputation: 46696
For such purpose, you need to use Strapi's webhooks: https://strapi.io/blog/webhooks
It can be integrated fairly easily into Netlify or any other good modern PaaS with ease. It will then trigger a rebuild of your app for you.
Upvotes: 1