Git Product home page Git Product logo

quasar-app-extension-api-wrapper's People

Contributors

angelroberto avatar robertolangarica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

migelbd armenr uiuxt

quasar-app-extension-api-wrapper's Issues

setting global parameters

Hello,
This is a nice utility. I wish there was some example on how to use it globally.
I was trying to set Global Configuration but it wasn't clear to me in which file to put theme.
I tried src\main\webapp\quasar.extensions.json with the following ( the "api-wrapper" was created automatically I don't know what for):

{
  "api-wrapper": {
    "baseURL" : "http://localhost:8080/api/v1/"
  }
}

that didn't work...

also as a boot file

// import something here

// "async" is optional;
// more info on params: https://quasar.dev/quasar-cli/boot-files
// export default async (/* { app, router, Vue ... } */) => {
export default async ({ app, router, store, Vue }) => {
  // something to do

  console.log('boot api-wrapper start')
  // `baseURL` will be prepended to any path provided unless the provided path is absolute.
   this.$api.baseURL = 'http://localhost:8080/api/v1'

  // The amount of attempts a request will make in the case of a timeout before failing completely
  this.$api.maxAttemptsPerCall = 1

  // The amount of concurrent requests that could be executed (when the requests number exceed this amount the requests are enqueue in a waiting mode)
  this.$api.simultaneousCalls = 5

  // Specifies the number of milliseconds before a request times out
  this.$api.timeout = 10000

  // Sets the default headers for 'Content-Type' for each request
  this.$api.setContentType(type = 'application/json')

  // Sets the default authorization header: 'Authorization' for each request
  this.$api.setAuthorization(token, type = 'Bearer')

  // If the store where not provided in the boot phase then it could be passed to the extension using this function
  // This will bring the module 'APIwrapper' available and the extension will start updating its state
  this.$api.setStore(vuex_instance)

  console.log('boot api-wrapper end')
}

got the below errors

Failed to compile.

./src/boot/api-wrapper-global.js
Module Error (from ./node_modules/eslint-loader/dist/cjs.js):

C:\src\git-repos\l4p-app\src\main\webapp\src\boot\api-wrapper-global.js
  23:28  error  'type' is not defined           no-undef
  26:30  error  'token' is not defined          no-undef
  26:37  error  'type' is not defined           no-undef
  30:22  error  'vuex_instance' is not defined  no-undef

โœ– 4 problems (4 errors, 0 warnings)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.