|
|
|
@ -85,9 +85,9 @@ module.exports = function HomeHandler(req, res) { |
|
|
|
|
|
|
|
|
|
res.setHeader('Content-Type', 'text/HTML) |
|
|
|
|
res.write(` |
|
|
|
|
<h1>Welcome back ${req.session.userid}</h1> |
|
|
|
|
<a href="/logout">Logout</a> |
|
|
|
|
`); |
|
|
|
|
<h1>Welcome back ${req.session.userid}</h1> |
|
|
|
|
<a href="/logout">Logout</a> |
|
|
|
|
`); |
|
|
|
|
|
|
|
|
|
res.end() |
|
|
|
|
} |
|
|
|
@ -113,13 +113,13 @@ module.exports = function LoginHandler(req, res) { |
|
|
|
|
|
|
|
|
|
res.setHeader('Content-Type', 'text/HTML) |
|
|
|
|
res.write(` |
|
|
|
|
<h1>Login</h1> |
|
|
|
|
<form method="post" action="/process-login"> |
|
|
|
|
<input type="text" name="username" placeholder="Username" /> <br> |
|
|
|
|
<input type="password" name="password" placeholder="Password" /> <br> |
|
|
|
|
<button type="submit">Login</button> |
|
|
|
|
</form> |
|
|
|
|
`); |
|
|
|
|
<h1>Login</h1> |
|
|
|
|
<form method="post" action="/process-login"> |
|
|
|
|
<input type="text" name="username" placeholder="Username" /> <br> |
|
|
|
|
<input type="password" name="password" placeholder="Password" /> <br> |
|
|
|
|
<button type="submit">Login</button> |
|
|
|
|
</form> |
|
|
|
|
`); |
|
|
|
|
|
|
|
|
|
res.end(); |
|
|
|
|
} |
|
|
|
|