1.0.3 • Published 3 years ago

servih v1.0.3

Weekly downloads
10
License
ISC
Repository
github
Last release
3 years ago

jooscode

My first contribution, simple https service provider to optimize works.

Pre requirements 📋

Install 🔧

npm i servih

or

yarn add servih

Example⌨️

create a .env.js file, at the root of the project

module.exports = "https://jsonplaceholder.typicode.com";

in main.js add servihOptions.

import {servihOptions} from 'servih'

servihOptions('use api token');

in your component, or store use. Has support (get, post, put, delete)

import {serviHttp} from 'servih'

export default {

   mounted() {
       this.test();
   },

    methods:{
        test:function(){
             serviHttp('posts', 'post', {name:'josedaniel'}).then(response=>{
                console.log(response);
                }).catch(errors=>{
                console.log(errors);
            });
        }
    }

}

Built with 🛠️

  • axios - Promise based HTTP client for the browser and node.js
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago