mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
417 B
21 lines
417 B
3 years ago
|
import { Api } from 'nocodb-sdk'
|
||
|
|
||
|
export function getApi($store, $axios) {
|
||
|
const api = new Api({
|
||
|
baseURL: 'http://localhost:8080',
|
||
|
headers: {
|
||
|
'xc-auth': $store.state.users.token
|
||
|
}
|
||
|
})
|
||
|
|
||
|
// overwrite with nuxt axios instance
|
||
|
api.instance = $axios
|
||
|
return api
|
||
|
}
|
||
|
|
||
|
export default function({ store: $store, $axios, ...rest }, inject) {
|
||
|
const api = getApi($store, $axios)
|
||
|
|
||
|
inject('api', api)
|
||
|
}
|