From d4ca07ce9c2a9c3e68d1387a437d9990b1ccdf15 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sun, 11 Apr 2021 13:08:41 +0200 Subject: [PATCH] Began working on character migration code --- .../api/creature/v1Migration/migrateCharacter.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/imports/api/creature/v1Migration/migrateCharacter.js diff --git a/app/imports/api/creature/v1Migration/migrateCharacter.js b/app/imports/api/creature/v1Migration/migrateCharacter.js new file mode 100644 index 00000000..6321c17f --- /dev/null +++ b/app/imports/api/creature/v1Migration/migrateCharacter.js @@ -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= + fetch(url) + .then(response => response.json()) + .then(data => { + let character = data.characters[0]; + console.log(character.name + ' fetched successfuly') + }); +}