Static GitHub Issues

[440] Multiple dynamic

prev: after .10 upgrade app does not start any more
next: Vendors build: when to use?

Hi, Sorry it’s me again!

Considering the changes in the generate routes configuration, I’m stuck because I have more than one dynamic routes to use.

I was using this, and I don’t see how to "translate" it to the new way:

routeParams: {
	'/blog/:slug': function () {
		return axios.get('https://rest.emmanuelbeziat.com/posts')
		.then((response) => {
			return response.data.map((post) => {
				return { slug: post.slug }
			})
		})
	},
	'/portfolio/:slug': function () {
		return axios.get('https://rest.emmanuelbeziat.com/portfolio')
		.then((response) => {
			return response.data.map((portfolio) => {
				return { slug: portfolio.slug }
			})
		})
	}
}

As the docs suggest to have a return, I don’t know how to pass it multiple routes. I took a look at the docs’s source, but it seems it’s still using the previous version.

Sorry, this one is totally a lack of JS knowledge on my side…

Thanks for your help.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c383">#c383</a>)</em></sub></div>