I encountered an issue while working on deploying my Nuxt.js page to Netlify. Everything went smoothly except for the dynamic pages I had created.
Below is a snippet from my nuxt.config.js file:
import axios from 'axios'
let dynamicRoutes = () => {
return axios.get('http://xxx.xxx.xxx.xx/casinos').then(res => {
return res.data.map(casino => `/casino/${casino.slug}`)
})
}
export default {
/*
** Nuxt rendering mode
** See https://nuxtjs.org/api/configuration-mode
*/
mode: 'universal',
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: 'static',
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
generate: {
routes: dynamicRoutes
},
Any help or suggestions would be greatly appreciated!