Wix
Erweitere deine Wix-Website mit der Occult API um Astrologie-Funktionen.
Velo by Wix
Mit Velo, der Entwicklungsplattform von Wix, rufst du die API aus Backend-Code auf.
Backend-Skript
So sieht ein Velo-Backend-Skript aus:
import { fetch } from 'wix-fetch';
export async function getHoroscope(sign) {
const apiKey = environment['OCCULT_API_KEY'];
const response = await fetch('https://api.occultapi.com/api/astro/rashifal/daily/', {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ rashi: sign }),
});
return response.json();
}Frontend
Zeig das Ergebnis mit einem Dataset oder einem Custom Element an.
Hinweise
API-Schlüssel gehören nie in Frontend-Code – nutz Velo-Backend-Funktionen.