This commit is contained in:
Иван Сунцов 2023-05-11 19:38:12 +03:00
parent add34d944a
commit 3634b6ea4e
2 changed files with 13 additions and 5 deletions

View File

@ -10,9 +10,20 @@
<body class="stackedit">
<div class="stackedit__html"><h1 id="значение-ножки">Значение ножки</h1>
<p>Парам-пам-пам</p>
<p id="txtt">Парам-пам-пам</p>
<pre><code></code></pre>
</div>
<script>
setInterval(() =>
fetch('/pin')
.then((response) => {
return response.json();
})
.then((data) => {
document.getElementById("txtt").innerHTML = data;
})
,2000);
</script>
</body>
</html>

View File

@ -44,11 +44,8 @@ const server = http.createServer((req, res) => {
if (req.url == "/") {
fs.readFile('index.html', 'utf-8', (err, data) => {
console.log(data);
if (err) {
res.writeHead(404, {
'Content-Type': 'application/json'
});
res.writeHead(404);
return;
}
res.writeHead(200, {