Created
March 22, 2013 16:17
-
-
Save mikeumus/5222620 to your computer and use it in GitHub Desktop.
Figuring how to augment DocPad's POST handling to incorporate the fileupload argument.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The fileupload module uses Express to handle the POST (https://github.com/domharrington/fileupload#usage): | |
app.post('/upload', fileupload, function(req, res) {} | |
# DocPad API tells that we can put DocPad atop a existing Express App: | |
# http://docpad.org/docs/api | |
# But it'd be nice if we could just do something closer to this: | |
server.post config.postUrl, fileupload, (req,res,next) -> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
server.post()
can take that middle argument offileupload
once you include.middleware
onvar fileupload = require('fileupload').createFileUpload('/uploadDir').middleware
Pointed out thanks to @formula1.