Browse Source

Add test server API for #63

Ben Hsieh 8 years ago
parent
commit
889c038186
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      test-server/server.js

+ 13
- 0
test-server/server.js View File

@@ -63,6 +63,19 @@ app.use(function(req, res, next) {
63 63
   next();
64 64
 })
65 65
 
66
+app.all('/echo', (req, res) => {
67
+  var body = ''
68
+  req.on('data', (chunk) => {
69
+    body+=chunk
70
+  })
71
+  req.on('end', () => {
72
+    res.send({
73
+      headers :  req.headers,
74
+      body : body
75
+    })
76
+  })
77
+})
78
+
66 79
 app.use(upload.any())
67 80
 app.use('/public', express.static('./public'))
68 81
 // for redirect test