Terribly Tiny Tales Task back end API

Used Request library to get the txt file from TTT.

Take the user's number count in a post request, call the TTT end point for the txt file.

Split the TTT text in words and store in an object with each word and its count as key value pairs.

Split object key-value in array and sort the array in DESC

Slice the array with user's count number and return a JSON response with the final data.

Components

server.js file for setting uo the Node environment.

routes.js for setting up the routes

words.js as the controller for the defined routes