0.1.3 • Published 4 years ago
fvi-axios-client v0.1.3
FVI - Axios Client
Esta biblioteca é resposável por realizar chamadas HTTP à um servidor de maneira fácil e rápida utilizando a lib axiosjs.
Configuração
Para configurarmos esta biblioteca devemos passar como parâmetro um Object contendo as informações abaixo:
{
url: 'http://google.com',
timeout: 1000,
headers: {
'Content Type': 'text/html'
}
}Modo de Usar
const client = app({
url: 'http://localhost:80',
timeout: 3000,
})
client
.get('/support/ping')
.then(res => res.data)
.then(console.log)
.catch(done)
client
.post('/support/ping')
.then(res => res.data)
.then(console.log)
.catch(done)
client
.put('/support/ping')
.then(res => res.data)
.then(console.log)
.catch(done)
client
.delete('/support/ping')
.then(res => res.data)
.then(console.log)
.catch(done)fvi-axios-client
npm run compile: Executa a limpeza dos arquivos e diretorios.npm run debug-test: Executa os testes unitários com o DEBUG ativo.npm run test: Executa os testes unitários.npm run debug-dev: Executa os testes unitários e espera por alterações com o DEBUG ativo.npm run dev: Executa os testes unitários e espera por alterçãoes.npm run prod: Executa o código com NODE_ENV=production.npm run coverage: Executa os testes unitários e retorna a cobertura dos códigos através do nycnpm run release: Inicia uma nova release de versão incrementando o patch, git flow release start.npm run release:minor: Inicia uma nova release de versão incrementando o minor, git flow release start.npm run release:major: Inicia uma nova release de versão incrementando o major, git flow release start.npm run release:finish: Finaliza a release, ou seja, realiza o git flow release finish.