handle signup request, add signup button link.

This commit is contained in:
sweatshirt0 2023-02-20 19:00:43 -05:00
parent 3ec60c7bcc
commit 0c4541eff6
5 changed files with 35 additions and 2 deletions

0
pages/about.html Normal file
View File

View File

@ -21,7 +21,7 @@
<input type="text" name="username" class="username" placeholder="Username" /><br/><br/>
<input type="password" name="password" class="password" placeholder="Password" /><br/><br/>
<input type="submit" name="submit" value="Login" class="loggin-submit" /><br/><br/>
<button class="signup-button" onclick="/signup">Sign Up</button>
<button class="signup-button"><a class="signup-link" href="/signup">Sign Up</a></button>
</form>
</div>
</div>

15
pages/signup.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Sign Up</title>
<link rel="stylesheet" type="text/css" href="./../styles/styles.css" />
</head>
<body>
<div class="whole-wrapper">
<div class="nav-wrapper">
<a class="home-link" href="/">Home</a>
</div>
</div>
</body>
</html>

View File

@ -78,6 +78,21 @@ const server = http.createServer((req, res) => {
res.end();
});
}
if (req.url === "/signup") {
res.statusCode = 200;
res.setHeader("Content-Type", "text/html");
fs.readFile("./pages/signup.html", (error, data) => {
if (error) {
res.writeHead(404);
res.wrtie("Error: File not found.");
} else {
res.write(data);
}
res.end();
});
}
});
const port = process.env.port || 9000;

View File

@ -88,10 +88,13 @@ body {
font-weight: bold;
}
.signup-link {
text-decoration: none;
}
.title-wrapper {
position: relative;
display: flex;
top: 22vh;
left: 8vw;
}