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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance