Files
serwerowe_stefanczyk/Lekcja_01/serverD.js
T
2026-09-09 19:31:31 +02:00

18 lines
358 B
JavaScript

const express = require("express")
const app = express()
const PORT = 3000
const path = require("path")
app.get("/product_id/:id", function(req, res) {
let id = req.params.id
res.sendFile(path.join(__dirname, "/static/products/product" + id + ".html"))
})
app.use(express.static('static'))
app.listen(PORT, function() {
console.log(PORT)
})