# Get top of request given the file exists in Node.js application

The user can specify which source to get the list, if the file is not found then Boom returns 404. After that, the found source will fetch the top list and append source, query and data in the response. It's simple as that. I'm just wondering if this code is clean enough to the industry standard.

This application is written in Hapi and using Boom. My code is really simple but I figure there must be something I can do to make it simpler.

  handleRequest: function handleRequest(request, reply) {
var source = request.params.source;
var handler;
try {
handler = require('../services/' + source);
} catch (err) {
err.message = 'Unknown Resource: ' + source;
}

handler.getTopList(request)
.then(function thenFunc(obj) {
var response = {};
if (source) {
response.source = source;
}
if (obj.query) {
response.query = obj.query;
}
response.data = obj.list;