Lekcja 3
This commit is contained in:
1 parent
e42104c4fb
commit
e80734527f
611 files changed
+64959
No files matched your search
@@ -0,0 +1,23 @@
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const port = 3000
|
||||
const path = require('path')
|
||||
|
||||
app.use(express.urlencoded({
|
||||
extended: true
|
||||
}))
|
||||
|
||||
app.use(express.json())
|
||||
|
||||
app.get("/", function(req, res) {
|
||||
res.sendFile(path.join(__dirname, '/static/range.html'))
|
||||
})
|
||||
|
||||
app.post("/range", function(req, res) {
|
||||
res.header("content-type", "application/json")
|
||||
res.send({"r2": req.body.r1})
|
||||
})
|
||||
|
||||
app.listen(port, function() {
|
||||
console.log("dziala")
|
||||
})
|
||||
Reference in new issue
Block a user