mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 17:37:14 +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)
|