registration page initiated.
This commit is contained in:
parent
c9967f50f3
commit
6c07e9eb3b
@ -10,6 +10,7 @@
|
||||
<div class="nav-wrapper">
|
||||
<a class="home" href="/">Home</a>
|
||||
<a class="about" href="/about">About</a>
|
||||
<a class="register" href="/register">Register</a>
|
||||
</div>
|
||||
<div class="title-wrapper">
|
||||
<h1 class="title">CasaChan</h1>
|
||||
|
15
pages/register.html
Normal file
15
pages/register.html
Normal file
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charse="UTF-8" />
|
||||
<title>Register</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="whole-wrapper">
|
||||
<div class="register-wrapper">
|
||||
<form class="register-form" action="register.js" method="POST">
|
||||
<input type="text" class="username" id="username" placeholder="Username" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
15
server.js
15
server.js
@ -39,6 +39,21 @@ const server = http.createServer((req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
if (req.url === "/register") {
|
||||
res.statusCode = 200;
|
||||
res.setHeader("Content-Type", "text/html");
|
||||
fs.readFile("./pages/register.html", function(error, data) {
|
||||
if (error) {
|
||||
res.writeHead(404);
|
||||
res.write("Error: File not found.");
|
||||
} else {
|
||||
res.write(data);
|
||||
}
|
||||
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
const port = process.env.port || 8000;
|
||||
|
Loading…
Reference in New Issue
Block a user