Skip to content

Instantly share code, notes, and snippets.

View AlexCR97's full-sized avatar
🐱
I like coding and cats

viex AlexCR97

🐱
I like coding and cats
  • Asterias Software Solutions
  • Jalisco, Mexico
View GitHub Profile
@AlexCR97
AlexCR97 / httpclient-example.ts
Last active February 9, 2025 21:27
Minimalist HTTP Client for TypeScript. Single file, no bloat, no dependencies, just copy and paste into your project.
import { useHttpClient } from "./httpclient";
// Create a client with a base URL and default headers
const client = useHttpClient({
baseUrl: "https://jsonplaceholder.typicode.com",
headers: {
"content-type": "application/json",
},
});
{
"Eslint Disable": {
"prefix": "eslint",
"body": "/* eslint-disable */",
},
"Simple log": {
"prefix": "cl",
"description": "Simple log",
"body": [
"console.log($1);"