Skip to content

Commit

Permalink
Merge pull request #139 from stereotech/develop
Browse files Browse the repository at this point in the history
CLOUD-178 and CLOUD-179: add dynamic routes
  • Loading branch information
frylock34 authored Jan 31, 2023
2 parents 1941eab + af035d2 commit 1f42f93
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require('dotenv').config()
import { NuxtConfig } from '@nuxt/types'
import axios from 'axios'
import ru from 'vuetify/src/locale/ru'

const locale = process.env.NUXT_ENV_LOCALE || 'ru'
Expand Down Expand Up @@ -206,7 +207,14 @@ const config: NuxtConfig = {
generate: {
dir: 'public',
fallback: true,
interval: 100
interval: 100,
routes: (): Promise<string[]> => {
return axios.get(`${process.env.API_STATAMIC}/collections/Pages/entries`).then(res => {
return res.data.data.map(value => {
return value.link
})
})
}
}
}

Expand Down
120 changes: 120 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@nuxtjs/vuetify": "^1.12.3",
"@nuxtjs/yandex-metrika": "^1.4.0",
"@stereotech/stereotech-brandbook": "^0.1.4",
"axios": "^1.2.6",
"front-matter": "^4.0.2",
"nuxt": "^2.15.8",
"vue-property-decorator": "^9.1.2",
Expand Down

0 comments on commit 1f42f93

Please sign in to comment.