K
K
Kind0fHeaven2019-11-29 14:03:47
Backup
Kind0fHeaven, 2019-11-29 14:03:47

How to make a dynamic page for a large number of nuxt.js posts?

Hello!
I made a dynamic page for events that are loaded from the api on the landing page. When you follow the link from the landing page, everything works as it should, but when you go to this page from scratch, an error pops up (404 Not Found). The same error occurs when reloading the page
I googled the option with dynamic route generation, but it does not seem possible, since there are more than 100k events

import axios from 'axios'
const dynamicRoutes = () => {
  return axios.get('https://your-api-here/products').then((res) => {
   return res.data.map(product => `/product/${product.id}`)
 })
}

How else can this problem be solved?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2018-12-07
@Baton72

This is not a way to store data, but a way to back up.
You make a server, set up backup using at least the same Cobian backup or any other software that is acceptable to you. For users, apart from the tray icon, nothing will change.

V
VegasChickiChicki, 2019-11-29
@VegasChickiChicki

https://en.nuxtjs.org/guide/dynamic-routes/ maybe so?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question