Lekcja 2
This commit is contained in:
1 parent
0d1dce5535
commit
72ed8ef789
612 files changed
+64975
No files matched your search
@@ -0,0 +1,22 @@
|
||||
const express = require("express")
|
||||
const app = express()
|
||||
const PORT = 3000
|
||||
|
||||
const path = require("path")
|
||||
|
||||
app.use(express.urlencoded({
|
||||
extended: true
|
||||
}))
|
||||
|
||||
app.get("/", function (req, res) {
|
||||
res.sendFile(path.join(__dirname, '/static/formularz_post_1.html'))
|
||||
})
|
||||
|
||||
app.post("/handle_form", function (req, res) {
|
||||
console.log(req.body)
|
||||
res.send(`<html><body style="background: ${req.body.colour};">${req.body.colour}</body></html>`)
|
||||
})
|
||||
|
||||
app.listen(PORT, function () {
|
||||
console.log(PORT)
|
||||
})
|
||||
Reference in new issue
Block a user