Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Show the changes you would make to the signup route handler. Reference the line numbers that should change and show the changed code. Question 3

image text in transcribed

Show the changes you would make to the signup route handler. Reference the line numbers that should change and show the changed code.

Question 3 Here is the main webserver code, named 'index.js': This question is about web application development. You are a middleware developer building a web application for a new sports centre called 'Lewisham Fitness', who have a pool and a gym. The centre requires an online form to allow new visitors to the site to sign up for the monthly newsletter. 13. var express - require ('express') 14. var bodyparser- require ('body-parser') 15. var mysq 1 - Yequire ('ANSWER4') You have written a node.js script with a route that adds data collected from a 'sign-up' form to a new user record in the database. 16. const app - ANSWER5 17. const port =8000 The form looks like this: 18. const db = mysq1, createconnection (f 19. host: 'localhost', 20. user: 'root', 21. password: 'password', database: 'ANSWER6' \begin{tabular}{l} Sign up for our monthly newsletter here: \\ Name: \\ Email: \\ \hline \end{tabular} 23. 11; The database is called LewishamFitness and the table is called 'users'. Here is the table creation script: Here is your code for the route handler in main.js

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions