From 20ee9592a7bba20cb784fb6c1eb07b61ad3f9415 Mon Sep 17 00:00:00 2001 From: vivek jain Date: Thu, 4 Apr 2019 17:26:27 +0530 Subject: [PATCH] index.js and index.html --- index.html | 17 +++++++++++++++++ index.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ readme.txt | 0 3 files changed, 62 insertions(+) create mode 100644 index.html create mode 100644 index.js delete mode 100644 readme.txt diff --git a/index.html b/index.html new file mode 100644 index 0000000..b7100a1 --- /dev/null +++ b/index.html @@ -0,0 +1,17 @@ + + + + + Signup Form + + + + +
+ Enter Username
+ Enter Password
+ +
+ + + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..69ec0cc --- /dev/null +++ b/index.js @@ -0,0 +1,45 @@ +const http = require('http'); +const url = require('url'); +const hostname="127.0.0.1"; +const port =8080; +const express=require('express'); +const server=http.createServer(function(req,res){ + var q=url.parse(req.url,true).query; + console.log("DATA",q); + res.writeHead(200,{"Content-Type":"text/html"}); + if(q['username']!=''){ + console.log("enter IF"); + res.write(""); + res.write(""); + res.write(""); + res.write("");res.write(""); + res.write(""); + res.write(""); + res.write(""); + + res.write(""); + res.write(""); + } + else{ + console.log("enter else"); + res.write(""); + res.write(""); + res.write("");res.write(""); + res.write(""); + res.write(""); + res.write(""); + res.write(""); + res.write(""); + } + + res.end(); +}); +server.listen(port,hostname,function(){ + console.log("server started on "+hostname+":"+port); +}); diff --git a/readme.txt b/readme.txt deleted file mode 100644 index e69de29..0000000