const router = require('express').Router(); const getFilePath = require('./index'); // router.get('/json/:filename', getJsonFile); router.get('/:type/*', (req, res) => { // console.log(req.params); const path = getFilePath(`${req.params.type}/${req.params[0]}.${req.query.type}`); res.sendFile(path); }) module.exports = router;