fix: environment variables - now using @nuxtjs/dotenv
This commit is contained in:
parent
dbd240c8ec
commit
305b4b8ca9
|
@ -3,16 +3,9 @@ const pkg = require('./package')
|
|||
module.exports = {
|
||||
mode: 'universal',
|
||||
|
||||
env: {
|
||||
urlInternal: process.env.URL_INTERNAL,
|
||||
urlExternal: process.env.URL_EXTERNAL,
|
||||
portApp: process.env.PORT_APP,
|
||||
portServer: process.env.PORT_SERVER,
|
||||
},
|
||||
|
||||
server: {
|
||||
port: process.env.portApp,
|
||||
host: process.env.urlInternal,
|
||||
port: process.env.PORT_APP,
|
||||
host: process.env.URL_INTERNAL,
|
||||
},
|
||||
|
||||
serverMiddleware: [
|
||||
|
@ -82,18 +75,20 @@ module.exports = {
|
|||
** Nuxt.js modules
|
||||
*/
|
||||
modules: [
|
||||
// Doc: https://github.com/nuxt-community/axios-module#usage
|
||||
'@nuxtjs/axios',
|
||||
// Doc: https://buefy.github.io/#/documentation
|
||||
'nuxt-buefy',
|
||||
// [
|
||||
// 'nuxt-sass-resources-loader',
|
||||
// [
|
||||
// '@/assets/scss/_globals.scss'
|
||||
// ]
|
||||
// ],
|
||||
'@nuxtjs/style-resources',
|
||||
'@nuxtjs/proxy',
|
||||
['@nuxtjs/dotenv', {
|
||||
path: '../',
|
||||
systemvars: true,
|
||||
only: [
|
||||
'URL_INTERNAL',
|
||||
'URL_EXTERNAL',
|
||||
'PORT_APP',
|
||||
'PORT_SERVER',
|
||||
],
|
||||
}]
|
||||
],
|
||||
|
||||
styleResources: {
|
||||
|
@ -106,12 +101,12 @@ module.exports = {
|
|||
axios: {
|
||||
// See https://github.com/nuxt-community/axios-module#options
|
||||
proxy: true,
|
||||
baseURL: 'http://' + process.env.urlExternal + ':' + process.env.portApp,
|
||||
baseURL: 'http://' + process.env.URL_EXTERNAL + ':' + process.env.PORT_APP,
|
||||
debug: false,
|
||||
},
|
||||
|
||||
proxy: {
|
||||
'/api/v1/': 'http://' + process.env.urlExternal + ':' + process.env.portServer
|
||||
'/api/v1/': 'http://' + process.env.URL_EXTERNAL + ':' + process.env.PORT_SERVER
|
||||
},
|
||||
|
||||
/*
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"@nuxtjs/dotenv": "^1.3.0"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@nuxtjs/dotenv@^1.3.0":
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@nuxtjs/dotenv/-/dotenv-1.3.0.tgz#fcfd8fa9da767ce1a79c11104ab998d610e23731"
|
||||
integrity sha512-gRs/NZJip+bame83Z4cQxMrMlVl0UjtXgM9TDIC37kLjUGbsvj/XJjAUbYgvubE1qtsc/PaNTaYXj5H73rpO/A==
|
||||
dependencies:
|
||||
dotenv "^6.0.0"
|
||||
|
||||
dotenv@^6.0.0:
|
||||
version "6.2.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"
|
||||
integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==
|
Loading…
Reference in New Issue