Question

Using repl.it, use the Express framework to host a Cloud Security Conference Signup page. A static...

Using repl.it, use the Express framework to host a Cloud Security Conference Signup page. A static HTML page that uses a form to ask the user for his email and name should be created in the public folder. On submit your application should display a message saying “Thank you for registering NAME, we will send you updates on EMAIL”. If the email provided is not valid (doesn’t have the @ character) then display an error message to him.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

// install express validator (server.js)

npm install express-validator

//The Express JS and Node JS Code

var express = require('express');

var bodyparser = require('body-parse');

var app = express();

app.set('view engine', 'ejs');

app.use(bodyParser.json());

app.use(bodyParser.urlencoded({ extended: false }));

//The HTML form(login.js)

app.get('/signup',function(req,res){

res.write('<html>');

res.write('<form action="http://localhost:3000/CloudSecuritySignUp" method="POST">');

res.write('<input type="email" name="email" placeholder="Enter Email"> <br>');

res.write('<input type="text" name="name" placeholder="Enter Name"> <br>');

res.write('<button type="submit">Create New </button><br>');

res.write('</form>');

res.write('</html>');

});


//Submit Operation(loginApp.js)

app.post('CloudSecuritySignUp',function(req,res){

// code to store the Email and Name to Public folder and show the sucess or error alerts

const fs = require('fs');


const { check, validationResult } = require('express-validator');

var Email = request.body.email;

var Name = request.body.name;

//Validating the Email

check('email').isEmail(),

errors = validationResult(req)

if (!errors.isEmpty()) {

response.send('The email you have entered is not valid, please register with a valid email address');

}

//writing the varaibles to a file of public folder

fs.writeFileSync('/publicFolder/registration.txt',Email,Name);

response.send('Thank you for registering NAME, we will send you updates on EMAIL');

}

Add a comment
Know the answer?
Add Answer to:
Using repl.it, use the Express framework to host a Cloud Security Conference Signup page. A static...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • URGENT HELP NEEDED: JQuery. PLEASE POST SCREEN SHOTS Task 1: Downloading jQuery Right-click the link to...

    URGENT HELP NEEDED: JQuery. PLEASE POST SCREEN SHOTS Task 1: Downloading jQuery Right-click the link to download the uncompressed latest version of jQuery Copy the jQuery.x.x.x.js file in the folder and specified as source file. Task 2: Download and install HTML-Kit 1. Navigate to htmlkit.com. 2. Click Download HTML-Kit 292. After it downloads, launch HKSetup.exe. Choose Full installation (the default) Uncheck Yes, download and install HTML-Kit Tools Trial. 6. Click Next>Finish. Task 3: Creating a Simple jQuery Application Launch HTML-Kit....

  • For milestone #1, we will start the CARIT site with three static HTML pages and a...

    For milestone #1, we will start the CARIT site with three static HTML pages and a CSS file. Create a dedicated folder for this project. This folder should contain all related files in this project. The future milestones are cumulative and built directly on top of your prior work. Function/content requirements: A home page named “index.html”, which include these contents at least: Description of the center. You may reference the example sites. Latest news: use list tags; make up some...

  • For this week's lab, you will use two of the classes in the Java Collection Framework:...

    For this week's lab, you will use two of the classes in the Java Collection Framework: HashSet and TreeSet. You will use these classes to implement a spell checker. Set Methods For this lab, you will need to use some of the methods that are defined in the Set interface. Recall that if set is a Set, then the following methods are defined: set.size() -- Returns the number of items in the set. set.add(item) -- Adds the item to the...

  • For this week's lab, you will use two of the classes in the Java Collection Framework:...

    For this week's lab, you will use two of the classes in the Java Collection Framework: HashSet and TreeSet. You will use these classes to implement a spell checker. Set Methods For this lab, you will need to use some of the methods that are defined in the Set interface. Recall that if set is a Set, then the following methods are defined: set.size() -- Returns the number of items in the set. set.add(item) -- Adds the item to the...

  • Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around...

    Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around risk and threat management, fostering an environment in which objectives seem clear: manage risk, manage threat, stop attacks, identify attackers. These objectives aren't wrong, but they are fundamentally misleading.In this session we'll examine the state of the information security industry in order to understand how the current climate fails to address the true needs of the business. We'll use those lessons as a foundation...

  • The following are screen grabs of the provided files Thanks so much for your help, and have a n...

    The following are screen grabs of the provided files Thanks so much for your help, and have a nice day! My Java Programming Teacher Gave me this for practice before the exam, butI can't get it to work, and I need a working version to discuss with my teacher ASAP, and I would like to sleep at some point before the exam. Please Help TEST QUESTION 5: Tamagotchi For this question, you will write a number of classes that you...

  • create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines....

    create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines. ** Each method below, including main, should handle (catch) any Exceptions that are thrown. ** ** If an Exception is thrown and caught, print the Exception's message to the command line. ** Write a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the method, check if the...

  • This is the contents of Lab11.java import java.util.Scanner; import java.io.*; public class Lab11 { public static...

    This is the contents of Lab11.java import java.util.Scanner; import java.io.*; public class Lab11 { public static void main(String args[]) throws IOException { Scanner inFile = new Scanner(new File(args[0])); Scanner keyboard = new Scanner(System.in);    TwoDArray array = new TwoDArray(inFile); inFile.close(); int numRows = array.getNumRows(); int numCols = array.getNumCols(); int choice;    do { System.out.println(); System.out.println("\t1. Find the number of rows in the 2D array"); System.out.println("\t2. Find the number of columns in the 2D array"); System.out.println("\t3. Find the sum of elements...

  • CASE 8 Unlocking the Secrets of the Apple iPhone in the Name of access the male...

    CASE 8 Unlocking the Secrets of the Apple iPhone in the Name of access the male San Bernardino suspect's iPhone 5c. Cook stated: Antiterrorism We are challenging the FBI's demands with the deepes respect for American democracy and a love of our country. We believe it would be in the best interest of everyone to step back and consider the implications While we believe the FBI's intentions are good, if would be wrong for the w e nt to force...

  • TORENTO CONSTRUCTION: ETHICAL CONTRACTING On December 27, 2010, Cary Holmes, manager of the Supply Chain Management...

    TORENTO CONSTRUCTION: ETHICAL CONTRACTING On December 27, 2010, Cary Holmes, manager of the Supply Chain Management (SCM) group at Torento Construction Inc. (NCG), was in his office in Torento, Ontario, trying to organize the thoughts running through his head as a result of a recent bidding to save operating costs at NCG. There was no problem in terms of the final outcome; in fact, the bid was going to result in cost savings of 25 per cent, which was exactly...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT