У меня есть сервер ubuntu 24.04 с ip 192.168.0.19 на котором стоит strapi…
- User
У меня есть сервер ubuntu 24.04 с ip 192.168.0.19 на котором стоит strapi (/home/user/api) и nuxt (/home/user/front). Я делал nuxt по инструкции и у меня файл nuxt.config.js в фронт выглядит так: export default { mode: 'universal', server: { host: '0.0.0.0', // по умолчанию: localhost port: 3000 // по умолчанию: 3000 },
/* ** Headers of the page / head: { title: process.env.npm_package_name || '', meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: process.env.npm_package_description || '' } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } ], script: [{ src: 'https://js.stripe.com/v3' }] }, / ** Customize the progress-bar color / loading: { color: '#fff' }, / ** Global CSS / css: [ "uikit/dist/css/uikit.min.css", "uikit/dist/css/uikit.css", ], / ** Plugins to load before mounting the App / plugins: [ { src: '~/plugins/uikit.js', ssr: false } ], / ** Nuxt.js dev-modules / devModules: [ ], / ** Nuxt.js modules */ modules: [ // Doc: https://axios.nuxtjs.org/usage '@nuxtjs/apollo', ],
apollo: { clientConfigs: { default: { httpEndpoint: 'http://localhost:1337/graphql' } } }, /* ** Axios module configuration ** See https://axios.nuxtjs.org/options / axios: { }, / ** Build configuration / build: { / ** You can extend webpack config here */ extend (config, ctx) { } } }
Но в инструкции написано следующее: Теперь, когда у нас есть необходимые зависимости, давайте импортируем @nuxtjs/apollo. Добавьте следующий модуль и конфигурации в свой nuxt.config.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // nuxt.config.js const strapiBaseUri = process.env.API_URL || "http://localhost:1337"; export default { // Modules: https://go.nuxtjs.dev/config-modules modules: ['@nuxtjs/apollo'],
// Apollo: https://github.com/nuxt-community/apollo-module#usage apollo: { clientConfigs: { default: { httpEndpoint: `${strapiBaseUri}/graphql`, } } } }Ссылка на новый UIkit в вашем nuxt.config.js так.
1 2 3 4 5 6 7 8 9 10 11 12 13 // nuxt.config.js export default { // Global CSS: https://go.nuxtjs.dev/config-css css: [ "uikit/dist/css/uikit.min.css", "uikit/dist/css/uikit.css", ],
- Assistant
Давайте попробуем объединить ваш существующий
nuxt.config.jsс рекомендациями из инструкции и убедимся, что конфигурации логично спроектированы. Совместим ваш текущий файл и советы из инструкции следующим образом: