Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/public/zadanie01/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
<!-- Twój kod -->
<html>
<body>
<form action="/sum" method="post">
Liczba a: <input type="text" name="a"><br>
Liczba b: <input type="text" name="b"><br>
<button type="submit">Wyślij</button>
</form>
</body>
</html>
9 changes: 8 additions & 1 deletion app/public/zadanie02/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
<!-- Twój kod -->
<html>
<body>
<form action="/cookie/set" method="post">
Imie: <input type="text" name="imie"><br>
<button type="submit">Wyślij</button>
</form>
</body>
</html>
8 changes: 8 additions & 0 deletions app/public/zadanieDnia/add.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<body>
<form action="/save" method="post">
<textarea type="text" name="content"></textarea> <br>
<button type="submit">Wyślij</button>
</form>
</body>
</html><!-- Twój kod -->
1 change: 0 additions & 1 deletion app/public/zadanieDnia/index.html

This file was deleted.

23 changes: 22 additions & 1 deletion app/zadanie01.js
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
//Twój kod
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.urlencoded());


app.use(express.static('./public/zadanie01/'));

app.post('/sum', (req, res) => {
const {a, b} = req.body;

if (!(parseInt(a) % parseInt(b))){
res.send('Liczba B jest dzielnikiem liczby A.')
} else {
res.send('Liczba B nie jest dzielnikiem liczby A.');
}
});


app.listen(3000, () => {
console.log('Wystartowalem serwerek na porcie 3000');
});