Update main.coffee
Browse files- main.coffee +12 -1
main.coffee
CHANGED
@@ -26,7 +26,18 @@ app.use (req, res, next) ->
|
|
26 |
# allow user to access file in tmpFolder
|
27 |
app.use '/file', express.static tmpFolder
|
28 |
|
29 |
-
app.all '/', (_, res) ->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
app.all '/upload', (req, res) ->
|
32 |
if req.method isnt 'POST'
|
|
|
26 |
# allow user to access file in tmpFolder
|
27 |
app.use '/file', express.static tmpFolder
|
28 |
|
29 |
+
app.all '/', (_, res) ->
|
30 |
+
res.setHeader 'Content-Type', 'application/json'
|
31 |
+
|
32 |
+
data =
|
33 |
+
status: 'alive'
|
34 |
+
message: 'POST /upload'
|
35 |
+
author: 'newtext'
|
36 |
+
|
37 |
+
result =
|
38 |
+
response: data
|
39 |
+
|
40 |
+
res.send JSON.stringify result, null, 2
|
41 |
|
42 |
app.all '/upload', (req, res) ->
|
43 |
if req.method isnt 'POST'
|