Nuxt/examples/i18n/plugins/axios.js
Alexandre Chopin b85de3151d example i18n
2017-02-08 20:13:14 +01:00

10 lines
249 B
JavaScript

import axios from 'axios'
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)