UNPKG

@yantra-core/yantra

Version:

Yantra.gg Serverless Physics SDK for Real-time Multiplayer Game Development

20 lines (16 loc) 512 B
import config from '../../config/config.js'; import axios from 'axios'; async function listWorlds(owner) { // Define the headers you want to add to the request. const headers = { 'yantra-token': this.accessToken }; let etherspaceEndpoint = this.etherspaceEndpoint || config.etherspaceEndpoint; let url = etherspaceEndpoint + `/api/v1/worlds/${owner}`; console.log('GET', url); let result = await axios.get(url, { headers: headers }); return result.data; } export default listWorlds;