Compare commits

...

2 Commits

3 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,7 @@
"description": "Rooster voor Het Heerenlanden om leerlingen te laten weten of ze binnen of buiten gym hebben", "description": "Rooster voor Het Heerenlanden om leerlingen te laten weten of ze binnen of buiten gym hebben",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1", "express": "^4.17.1",
"mustache-express": "^1.3.0", "mustache-express": "^1.3.0",
"mysql": "^2.18.1" "mysql": "^2.18.1"

View File

@ -15,6 +15,8 @@ app.set('views', path.resolve('views/'));
app.engine('mustache', mustacheExpress(path.resolve('views/partials/'), '.mustache')); app.engine('mustache', mustacheExpress(path.resolve('views/partials/'), '.mustache'));
app.use(express.urlencoded());
var vars = { var vars = {
username: 'ARN' username: 'ARN'
} }
@ -31,6 +33,11 @@ app.get('/login/', (req, res) => {
res.render('login', vars); res.render('login', vars);
}); });
app.post('/login', (req, res) => {
console.log(req.body)
res.send('login attempt using the following credentials:');
});
app.get('/scss/:file', (req, res) => app.get('/scss/:file', (req, res) =>
res.sendFile(path.resolve('scss/' + req.params.file)) res.sendFile(path.resolve('scss/' + req.params.file))
); );

View File

@ -5,6 +5,11 @@
{{> nav}} {{> nav}}
<main> <main>
<h1>Login</h1> <h1>Login</h1>
<form method="post" action="#">
<input placeholder="Gebruikersnaam" type="text" name="username">
<input placeholder="Wachtwoord" type="text" name="password">
<button type="submit">Inloggen</button>
</form>
</main> </main>
{{> footer}} {{> footer}}
</body> </body>