add variable api

This commit is contained in:
vincent 2019-04-24 18:13:46 +02:00
parent 80ce05b35d
commit 0842cfc3d1
4 changed files with 10 additions and 18 deletions

View File

@ -3,6 +3,7 @@ const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
NODE_ENV: '"development"',
ROOT_API:'"http://localhost:5000"',
})

View File

@ -10,13 +10,7 @@ module.exports = {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api/v1/chaine': {
target: 'http://localhost:5000',
changOrigin: true
}
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
@ -56,12 +50,7 @@ module.exports = {
assetsRoot: path.resolve(__dirname, '../../backend/dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/chainetv/',
proxyTable: {
'/api/v1/chaine': {
target: 'chainetv/api/v1/chaine',
changOrigin: false
}
},
/**
* Source Maps

View File

@ -1,4 +1,5 @@
'use strict'
module.exports = {
NODE_ENV: '"production"'
NODE_ENV: '"production"',
ROOT_API:'/chainetv'
}

View File

@ -32,7 +32,8 @@ export default {
},
methods: {
getchaine(num) {
let path = '/api/v1/chaine/';
let path = process.env.ROOT_API + '/api/v1/chaine/';
path += num;
axios.get(path)
.then((res) => {
@ -49,7 +50,7 @@ export default {
},
parsechaine() {
const path = '/api/v1/chaine/';
const path = process.env.ROOT_API + '/api/v1/chaine/';
axios.put(path)
.then((res) => {
this.message = res.data;