handle signup request, add signup button link.
This commit is contained in:
parent
3ec60c7bcc
commit
0c4541eff6
0
pages/about.html
Normal file
0
pages/about.html
Normal 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
15
pages/signup.html
Normal 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>
|
15
server.js
15
server.js
@ -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;
|
||||
|
@ -88,10 +88,13 @@ body {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.signup-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.title-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
top: 22vh;
|
||||
left: 8vw;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user