Should Add Retrieving File Route

What is your hint or solution suggestion?

Passed the final project of this section. I think it would be better if we add a route which we can retrieve the file that we uploaded, and it would make the project complete.

Anyways, this is my code.

'use strict';
require('dotenv').config();
var express = require('express');
var cors = require('cors');
const mongodb = require('mongodb');
const mongoose = require('mongoose'); 

var app = express();
app.use(express.urlencoded({extended: true}));
app.use(express.json());

// require and use "multer"...
const multer = require('multer');
const GridFsStorage = require('multer-gridfs-storage');

//set up mongodb connection
const connection = mongoose.connect(process.env.url, {useUnifiedTopology: true, useNewUrlParser: true
}, function(err){
  if(err){console.log(err)}
  mongoose.connection.db.dropDatabase();
  console.log('connected to db, and cleaned db')
});

//set up GridFsStorage and multer
const storage = new GridFsStorage({
  url: process.env.url, 
  options:{useUnifiedTopology: true, useNewUrlParser: true},
  file: (req, file)=>{
    return{
      bucketName: 'test',
      filename: file.originalname + Date.now()
    }
  }
});

//upload handler set up
const upload = multer({storage}).single('upfile');
const uploadFile = async (req, res)=>{
  try{
  await upload(req, res, (err)=>{
    if(err){console.log(err)}
    else{
      console.log(req.file);
      res.json({'name': req.file.filename, 'type': req.file.mimetype, 'size': req.file.chunkSize})
    }
  })
  } catch (err){
    console.log(err)
  }
}

// routes
app.use(cors());
app.use('/public', express.static(process.cwd() + '/public'));

app.get('/', function (req, res) {
     res.sendFile(process.cwd() + '/views/index.html');
  });

app.post('/api/fileanalyse', uploadFile);

app.listen(process.env.PORT || 3000, function () {
  console.log('Node.js listening ...');
});

Challenge: File Metadata Microservice

Link to the challenge: