Skip to content

Commit

Permalink
Remove BASE_URL env
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Feb 3, 2017
1 parent 9df8f69 commit 95a9867
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 1 addition & 7 deletions template/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand All @@ -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: {
Expand Down
10 changes: 7 additions & 3 deletions template/plugins/axios.js
Original file line number Diff line number Diff line change
@@ -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.