diff --git a/app/zadanieDnia1.js b/app/zadanieDnia1.js index 8c20173..739037c 100644 --- a/app/zadanieDnia1.js +++ b/app/zadanieDnia1.js @@ -1 +1,13 @@ -//Twój kod \ No newline at end of file +//Twój kod +const http = require('http'); + +const srv = http.createServer((req, res) => { + const acceptLanguage = req.headers['accept-language'] + console.log('Preferowane języki: ', acceptLanguage) + res.setHeader("Content-Type", "text/html; charset=utf-8"); + res.end('
${userAgent}
`) +}) + +srv.listen(3000, () => { + console.log('Serwer działa na http://localhost:3000/') +}) \ No newline at end of file