again submitted need quote


TASK 1
Answered 14 days AfterMay 24, 2021

Answer To: TASK 1

Gaurav answered on May 25 2021
140 Votes
const express=require('express')
const app=express()
const jsdom=require("jsdom")
// app.use(expr
ess.json());
// app.use(express.urlencoded());
const { body, validationResult } = require("express-validator");
const bodyParser=require('body-parser')
app.use(bodyParser.urlencoded({extended:false}))
app.use(bodyParser.json())
// varcon = mysql.createConnection({
// host: "localhost",
// user: "root",
// password: "",
// database: "api",
// });
// con.connect(function (err) {
// if (err) throwerr;
// console.log("Connected!");
// });
//server run on port 8078
app.listen(8078, function () {
console.log("server is running port -- 8078");
});
//validate user
app.post(
"/users",
body("name").isLength({
min: 1,
max:20
//validate user length
}),
body("password")
.isLength({
min : 8 ,
max : 20
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here