mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-01 01:47:11 +00:00
10 lines
249 B
JavaScript
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)
|