Posts

Showing posts with the label regex

Adding Searching Functionality In Node

In this article we see how we can enable the searching of data from server in our node application. Setup The Folder  a) Make a new folder using command prompt.Type the following command. mkdir search b) change to the new folder cd search Setup Node In Folder For setting up node we type the following command npm init -y it will initialize the node in our project. And we get a package.json file in our folder. Which  means node is initialized in our folder. Install Packages Now we install the packages which will be required for building the application. npm install express ejs body-parser mongoose. Add New Folder models views models - this will contain our schema of collections(table). views - will contain the ejs pages.   Model Add new file in folder name it data.js Views Add 2 folders a)pages b)partial In partial folder add 2 new files header.ejs and footer.ejs header.ejs footer.ejs In pages add home.ejs file.