Created
March 29, 2016 00:55
-
-
Save emilong/2f80a07c17727bb2a428 to your computer and use it in GitHub Desktop.
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
// Factory | |
function createPdfsController(PdfService) { | |
return { | |
create: function(req, res, next) { | |
const content_id = req.params.content_id; | |
const pdf_id = PdfService.generate(content_id); | |
res.json({ pdf_id: pdf_id }); | |
} | |
}; | |
} | |
// Export a function that registers the service provider with the given container. | |
modules.export = function(bottle) { | |
bottle.service( | |
'controller.Pdfs', // the name of the service we're providing | |
createPdfsController, // the factory to create the service instance | |
'service.PdfGenerator' // the dependencies required to create the factory | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment