Posts

Showing posts from May, 2024

Express JS - Basic Web Programming Tasks

Below listed programming tasks are designed to practice different concepts of server side web programming using Express JS and related modules. These are to make the understanding of concepts along with their implementation clear, some of them may not represent practical requirements. Make a header in header.ejs and include this header in all EJS pages. Add /home link in header. In same way, make a footer in footer.ejs and include this footer in all EJS pages. Make a handler /queryhandler, it shall display all query string parameters sent to server at server console. Make another handler i.e. /queryhandler2, on GET reuquest, it shall display all submitted request parameters to user screen using show.ejs Create a form to Add New Book and serve at /add-book on GET request. Take Title, Author Name, Published Year, and Publisher Name as input fields from the user. Handle form submission using POST at same URL i.e. at /add-book, the handler shall display the submited data on user browser us

Create an Address Book using Express and EJS

 Create an application using Express, the application shall have following features: Make a JSON file named users.json. It shall be an array of objects where each object shall represent a contact person detail. Only 2-3 records are sufficient. Use following fields for each object: name, gender, email, city, phone number. Below given description is about different operations that you shall implement in your app to perform CRUD operations on file. List all records:  At /home ... list only contact persons' names in tabular form. The table shall have columns: ID, Name, Operations. Display user ID in ID column, Operations column shall have two links or buttons i.e. Update, Delete. When these links or buttons are clicked, pass user id to /update and /delete handler. Update Record When user click Update link or button, GET request shall be sent to server to URL pattern /update. Pass user id as query-string e.g. /update?id=10. The /update handler shall open the Update Form where earlier co