- Demo here
-
The node server listens for get requests at
/api/countand usesroutes/count.jsto handle it. -
The .txt file is requested using the request module, split and converted into an array of words.
-
Each word is mapped to its count/frequency i.e a (key,value) pair dictionary is generated.
-
Nis retrieved from the request parameters and the first n words are sent back.
-
Angular based client has a single AppComponent which sends a request to get words with their frequencies by sending
Nas a parameter. -
Retrieved data is displayed in a table.
-
Karma-Jasmine is used for basic unit testing.