Spaces:
Running
Running
Download api-config.js from kai774/api-integration-wizards: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/spaces/kai774/api-integration-wizards/resolve/main/api-config.js
- Command line
-
hf download hf://spaces/kai774/api-integration-wizards/api-config.js
-
curl -L -o api-config.js https://huggingface.co/spaces/kai774/api-integration-wizards/resolve/main/api-config.js
1.32 kB
| // API Configuration for Hanzi Hunter | |
| class APIConfig { | |
| constructor() { | |
| this.apis = { | |
| // Free Chinese Dictionary API | |
| dictionary: { | |
| url: 'https://api.dictionaryapi.dev/api/v2/entries/zh/', | |
| method: 'GET' | |
| }, | |
| // HanziDB API for character information | |
| hanzi: { | |
| url: 'https://hanzi-db.herokuapp.com/api/characters/', | |
| method: 'GET' | |
| }, | |
| // Mock HSK API (you can replace with real API) | |
| hsk: { | |
| url: 'https://jsonplaceholder.typicode.com/posts', | |
| method: 'GET' | |
| }, | |
| // Backend API (replace with your actual backend URL) | |
| backend: { | |
| url: 'https://your-backend-api.com/api/', | |
| method: 'POST' | |
| } | |
| }; | |
| } | |
| // Method to set custom API endpoints | |
| setAPI(name, url, method = 'GET') { | |
| this.apis[name] = { url, method }; | |
| } | |
| // Method to get API configuration | |
| getAPI(name) { | |
| return this.apis[name]; | |
| } | |
| // Method to update all API configurations | |
| updateAPIs(newConfigs) { | |
| this.apis = { ...this.apis, ...newConfigs }; | |
| } | |
| } | |
| // Create global API config instance | |
| window.apiConfig = new APIConfig(); |