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
   res.send('man')
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
 // handle multipart/form-data request
99
 // handle multipart/form-data request
88
 app.post('/upload-form', formUpload)
100
 app.post('/upload-form', formUpload)
89
 
101