Skip to content

Instantly share code, notes, and snippets.

View Thinkedou's full-sized avatar
🏔️

Rémi Thinkedou

🏔️
View GitHub Profile
@Thinkedou
Thinkedou / HttpService.ts
Created November 4, 2025 09:01
Simple httpService with jwt
/**
* Simple monolithic HTTP service using native fetch.
* - Automatically adds Authorization header if JWT token exists in localStorage
* - JSON body serialization / deserialization
* - Centralized error handling
*/
export class HttpService {
private baseUrl: string;
private defaultHeaders: Record<string, string>;
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-tooltip/core-tooltip.html">
<link rel="import" href="../topeka-elements/category-images.html">