diff --git a/content/.vuepress/components/Step2.vue b/content/.vuepress/components/Step2.vue index d916506..b4954ba 100644 --- a/content/.vuepress/components/Step2.vue +++ b/content/.vuepress/components/Step2.vue @@ -20,7 +20,7 @@ -
+

Image Text

@@ -81,7 +81,7 @@
- +
@@ -167,8 +167,15 @@ export default { ctx.fillText(this.bottomLine.toUpperCase(), canvasWidth / 2, (canvasHeight - 40)); }, submit () { - // TODO: Do the upload - EventBus.$emit('HookFileUploaded', 'txhashhere'); + var component = this; + component.isLoading = true; + component.$http.post('https:/lbry.tech/upload-image', document.getElementById('meme-canvas').toDataURL('image/png')).then(function(response) { + component.isLoading = false; + console.log(response); + }); + + //EventBus.$emit('HookFileUploaded', 'txhashhere'); + }, imagesLoaded (instance) { var component = this; diff --git a/server.js b/server.js index 2c33235..535ed86 100644 --- a/server.js +++ b/server.js @@ -102,6 +102,21 @@ app.get('/github-feed', function(req, res) { }); +app.post('/upload-image', function(req, res) { + + request({ + method: "PUT", + url: "http://daemon.lbry.tech/images.php", + qs: { + access_token: process.env.LBRY_DAEMON_ACCESS_TOKEN + }, + body: req.body, + }, function(error, response, body) { + res.json(body); + }); + +}); + app.get('/*', function(req, res) { if(fs.existsSync(__dirname + "/.vuepress/dist" + req.path + ".html")) {