Question: 2. Fill in the gaps in the following server.js code to process data posted from above form, including the code of using middleware to process
2. Fill in the gaps in the following server.js code to process data posted from above form, including the code of using middleware to process the form's POST submission. Once receive the form, the server should return a JSON string in the following format: [7 marks] message: "Student: fullName (studentNum, Pogram: program) successfully added"} Note: fullName, studentNum, and program represent the values entered by user. var express = require("express"); var app = express(); var var HTTP_PORT = process.env.PORT || 8080; app.use(express.static('public')); app.listen(HTTP_PORT, O => { console.log("Express http server listening on:" + HTTP_PORT); }); Student Number Question 2 (11 Marks): 1. Recreate the html form (right) using valid HTML according to the following specification: (4 marks] Your form MUST submit using "POST" to "/addStudent You are ONLY required to code the form sform>... part, not entire document. No
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
Students Have Also Explored These Related Databases Questions!