Began working on character migration code

This commit is contained in:
Stefan Zermatten
2021-04-11 13:08:41 +02:00
parent 885607f685
commit d4ca07ce9c

View File

@@ -0,0 +1,12 @@
import { fetch } from 'meteor/fetch'
export default function importCharacter(url){
// Using v1's JSON API to fetch the character data in a nice format
// url -> https://dicecloud.com/character/HxerC2ZYXKrNc8u2M/json?key=<key>
fetch(url)
.then(response => response.json())
.then(data => {
let character = data.characters[0];
console.log(character.name + ' fetched successfuly')
});
}