Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getRoutes: async () => {
const { data: posts } = await axios.get(
'https://jsonplaceholder.typicode.com/posts'
)
const allPosts = []
const sidebarInfo = createSharedData({
foo: 'bar',
})
let i = 0
while (i < routeSize) {
i++
const post = posts[i % posts.length]
allPosts.push({
...post,
id: i,
body: `${post.body} ${i}`,
})
}
return [
...(!process.env.PAGINATION
getRoutes: async () => {
const { data: posts } = await axios.get(
'https://jsonplaceholder.typicode.com/posts'
)
const allPosts = []
const sidebarInfo = createSharedData({
foo: 'bar',
})
let i = 0
while (i < routeSize) {
i++
const post = posts[i % posts.length]
allPosts.push({
...post,
id: i,
body: `${post.body} ${i}`,
})
}
return [
...(!process.env.PAGINATION