axios-eve

1.2.6 • Public • Published

axios-eve

Promise based HTTP client for api build up on eve-framework

Installing

Using npm:

$ npm install axios-eve

Example

// declare endpoits
let config =  [
        {
            "url": "area",
            "type": "eve",
            "methods": ["GET"]
        },
        {
            "url": "questions",
            "type": "eve",
            "methods": ["GET"]
        },
        {
            "url": "user",
            "type": "eve",
            "methods": ["GET"]
        },
        {
            "url": "user/admin",
            "type": "eve",
            "methods": ["POST"]
        },
        {
            "url": "area/{name}",
            "type": "eve",
            "methods": ["GET"] 
        }
    ]

let api = new Api({
  urls: config,
  baseURL: 'http://localhost:8000',
  headers: {
      'Cache-Control': 'no-cache'
  },
  timeout: 1500
})

// return areas
api.getArea({})

// return page 2 
api.getQuestions({page: 2})

// sort by name
api.getUser({sort: {name: 1}})

Package Sidebar

Install

npm i axios-eve

Weekly Downloads

3

Version

1.2.6

License

MIT

Unpacked Size

31.2 kB

Total Files

15

Last publish

Collaborators

  • gutorc92