diff options
Diffstat (limited to 'bucky')
| -rw-r--r-- | bucky/app/federate.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/bucky/app/federate.js b/bucky/app/federate.js index 01b85a1..e5843d7 100644 --- a/bucky/app/federate.js +++ b/bucky/app/federate.js @@ -18,6 +18,9 @@ module.exports = { new model(req.body).save().then((el) => { res.el = el; next() + }).catch(e => { + console.error(e) + next() }) } } @@ -49,6 +52,9 @@ module.exports = { return promises }).then( () => { next() + }).catch(e => { + console.error(e) + next() }) } function send(type, data){ @@ -56,9 +62,13 @@ module.exports = { var json = data.toJSON() fetch("https://bucky.asdf.us/raw/import/" + type, { method: 'PUT', - body: json, - headers: { 'content-type': 'application/json; charset=utf-8' }, - }).then(() => {}) + body: JSON.stringify(json), + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }, + }).then((res) => {return res.json()}) + .then((json) => console.log(json)) } } |
