Files
pos-system/microservices/packages/http-client
Ho Ngoc Hai 76d75c753b Migrate
2026-05-23 18:37:02 +07:00
..
2026-05-23 18:37:02 +07:00
2026-05-23 18:37:02 +07:00
2026-05-23 18:37:02 +07:00
2026-05-23 18:37:02 +07:00
2026-05-23 18:37:02 +07:00

@goodgo/http-client

HTTP client wrapper with Axios, automatic token management, and error handling.

Usage

import { createHttpClient } from '@goodgo/http-client';

const client = createHttpClient({
  baseURL: 'http://api.example.com',
  timeout: 30000,
});

// GET request
const response = await client.get('/users');

// POST request
const result = await client.post('/auth/login', {
  email: 'user@example.com',
  password: 'password',
});

// Set auth token
client.setAuthToken('your-token-here');