{"size": 737, "ext": "js", "max_stars_repo_path": "modules/videoTutorialContribution/routes.js", "max_stars_repo_name": "project-anuvaad/COMET-api-service", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "modules/videoTutorialContribution/routes.js", "max_issues_repo_name": "project-anuvaad/COMET-api-service", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "modules/videoTutorialContribution/routes.js", "max_forks_repo_name": "project-anuvaad/COMET-api-service", "max_forks_repo_forks_event_min_datetime": "2021-03-01T08:22:44.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-01T08:22:44.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.4137931034, "max_line_length": 94, "alphanum_fraction": 0.6295793758}
const multer = require('multer');
const controller = require('./controller');

var storage = multer.diskStorage({
    destination: function (req, file, cb) {
        cb(null, '/tmp')
    },
    filename: function (req, file, cb) {
        cb(null, file.fieldname + '-' + Date.now() + '.' + file.originalname.split('.').pop())
    }
})
var upload = multer({ storage: storage })

// external modules should call the mount function and pass it an instance 
// of the router to add the module's routes to it
const mount = function (router) {
    // Define module routes here
    
    
    router.post('/', upload.any(), controller.uploadVideo)
    router.get('/', controller.getVideos)

    return router;
}

module.exports = {
    mount,
}
