Permalink
Browse files

Remove BASE_URL env

  • Loading branch information...
Atinux committed Feb 2, 2017
1 parent 9df8f69 commit 95a9867b1108777932779c4fc46ef0a0522811b5
Showing with 8 additions and 10 deletions.
  1. +1 −7 template/nuxt.config.js
  2. +7 −3 template/plugins/axios.js
@@ -7,7 +7,7 @@ module.exports = {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', content: 'Nuxt.js project' }
{ hid: 'description', name: 'description', content: 'Nuxt.js project' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: 'favicon.ico' }
@@ -18,12 +18,6 @@ module.exports = {
*/
css: ['~assets/css/main.css'],
/*
** Add env variables
*/
env: {
baseURL: process.env.BASE_URL || 'http://localhost:3000'
},
/*
** Add axios globally
*/
build: {
@@ -1,5 +1,9 @@
import axios from 'axios'

export default axios.create({
baseURL: process.env.baseURL
})
let options = {}
// The server-side needs a full url to works
if (process.SERVER_BUILD) {
options.baseURL = `http://${process.env.HOST || 'localhost'}:${process.env.PORT || 3000}`
}

export default axios.create(options)

0 comments on commit 95a9867

Please sign in to comment.