downloadRoutes.js

var jwt = require("jsonwebtoken");
var async = require("async");
var dbCollections = require('../../config/db/dbCollections');

function downloadRoutes(app, routeOptions) {
    // List of collections available
    // var DB = dbCollections(routeOptions.database);

    app.post('/api/download/docx', function(req, res) {
        var inputs = req.body.inputs;
        DownloadFile.generateDocx(req, res, inputs);
    });

    app.post('/api/download/rtf', function(req, res) {
        var inputs = req.body.inputs;
        DownloadFile.generateRtf(req, res, inputs);
    });
}

module.exports = downloadRoutes;