Initializing the Application

To implement the tables view, you need a database of words. Listing 29.20 provides a basic Node.js application that implements the words database used in this chapter. You need to run this before you can test the tables view defined in the previous sections. You need to modify the words variable on line 3 to include the words you want in the database. The example on the book’s website includes about 5,000 words.

Listing 29.20 word_init.js: Initializing the words database for the tables view

01 var vowelArr = "aeiou";02 var consenantArr = "bcdfghjklmnpqrstvwxyz";03 var words = "the,be,and,of,a,in ... ,middle-class,apology,till";04 var wordArr = words.split(",");05 var wordObjArr = new ...

Get Node.js, MongoDB, and AngularJS Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.