Open jsms90 opened 7 years ago
Definitely agree with modularising the server. Consider putting your routes in another file, then requiring them in like so:
const routes = require('./routes.js');
server.route(routes);
The functions you've named (processWeatherObject
, processArticles
) are not actually handler functions, but functions used within the handler for the '/'
endpoint (if that makes sense), so maybe it would make more sense to put them in a file named something else.
handler.js to contain 2 functions: