|
@@ -41,19 +41,7 @@ app.use('/public', express.static('./public'))
|
41
|
41
|
app.get('/redirect', function(req, res) {
|
42
|
42
|
res.redirect('/public/github.png')
|
43
|
43
|
})
|
44
|
|
-// handle octet-stream request
|
45
|
|
-app.post('/upload', function(req, res){
|
46
|
44
|
|
47
|
|
- console.log(req.headers)
|
48
|
|
- console.log(req.body)
|
49
|
|
- fs.writeFile('./uploads/file'+Date.now()+'.png', req.body,function(err){
|
50
|
|
- if(!err)
|
51
|
|
- res.status(200).send({ message : 'ok'})
|
52
|
|
- else
|
53
|
|
- res.status(500).send({ message : err})
|
54
|
|
- })
|
55
|
|
-
|
56
|
|
-})
|
57
|
45
|
// return an empty response
|
58
|
46
|
app.all('/empty', function(req, res) {
|
59
|
47
|
res.send('')
|