Browse Source

Add test server API for #45 test cases

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

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

@@ -84,6 +84,18 @@ app.delete('/hey', function(req, res) {
84 84
   res.send('man')
85 85
 })
86 86
 
87
+app.post('/mime', mimeCheck)
88
+app.put('/mime', mimeCheck)
89
+
90
+function mimeCheck(req, res) {
91
+  console.log(req.files)
92
+  var mimes = []
93
+  for(var i in req.files) {
94
+    mimes.push(req.files[i].mimetype)
95
+  }
96
+  res.send(mimes)
97
+}
98
+
87 99
 // handle multipart/form-data request
88 100
 app.post('/upload-form', formUpload)
89 101