1.11.1 • Published 2 years ago

@spruce-hub/nuxt-fetch v1.11.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@spruce-hub/nuxt-fetch

Usage

npm install @spruce-hub/nuxt-fetch --save
# or
pnpm add @spruce-hub/nuxt-fetch -P

Quick start

// nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    [
      '@spruce-hub/nuxt-fetch',
      {
        '/api': {
          pathRewrite: {
            '^/api': 'api',
          },
          apiHostEnv: 'API_HOST',
          apiHostUrl: 'http://api.com',
          cookieName: 'access_token',
        },
        '/api2': {
          pathRewrite: {
            '^/api2': '/api',
          },
          apiHostEnv: 'API_HOST',
          apiHostUrl: 'http://api2.com',
          cookieName: 'access_token',
        },
      },
    ],
  ],
})
const { data, pending, error, refresh } = await useFetch('/api/example')

// http://localhost/api/example => http://myapi.com/api/example

License

MIT

Copyright (c) 2023-present, Spruce FE

1.2.0

2 years ago

1.11.1

2 years ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.3.2

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.1.2

2 years ago

1.11.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago