Pārlūkot izejas kodu

examples: Some fixes for DO

Renée Kooi 7 gadi atpakaļ
vecāks
revīzija
6cbae6fa41

+ 0 - 7
examples/digitalocean-spaces/aliasify.js

@@ -1,7 +0,0 @@
-const path = require('path')
-
-module.exports = {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
-  }
-}

+ 0 - 1
examples/digitalocean-spaces/package.json

@@ -4,7 +4,6 @@
   "scripts": {
     "start": "node ./server.js"
   },
-  "aliasify": "aliasify.js",
   "devDependencies": {
     "aliasify": "^2.1.0",
     "babelify": "^7.3.0"

+ 7 - 2
examples/digitalocean-spaces/server.js

@@ -41,7 +41,8 @@ app.post('/params', (req, res, next) => {
   }, (err, data) => {
     if (err) return next(err)
 
-    res.json({ method: 'put', url: data })
+    res.setHeader('content-type', 'application/json')
+    res.end(JSON.stringify({ method: 'put', url: data }, null, 2))
   })
 })
 
@@ -60,7 +61,11 @@ budo(path.join(__dirname, 'main.js'), {
   browserify: {
     transform: [
       'babelify',
-      'aliasify'
+      ['aliasify', {
+        replacements: {
+          '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
+        }
+      }]
     ]
   }
 })