Category : server

I’m using OBS-WebSocket.js as a component (available on server) to call for change the OBS scenes, through OBS websockets. This way is compatible with all platforms, I can load the main html page from server and clicking a button I can switch the scenes. I would find a way now to kill and reload OBS ..

Read more

I am getting an error in fetch API while calling the django server. The request used here is: async function analyse() { await fetch("http://localhost:8000/classify/", { method: ‘POST’, body: JSON.stringify({ premise: document.getElementById(‘pre’).value, hypothesis: document.getElementById(‘hypo’).value, }), headers: { "Content-Type": "application/json; charset=UTF-8", "Authorization":"Basic c2hhc2h2YXQ6cGFuZGV5" } }).then(function (response) { console.log(response); return response.json() }).then(function (text) { console.log(text); }).catch(err => { ..

Read more

i’ve been learning Node for a while by watching some tutorials and reading the documentation… But when I read some others code, I notice that usually, async methods are preferable over sync methods, wich I find easier. const http = require("http"); const fs = require("fs"); http.createServer(function (req, res){ if(req.url == "/"){ fs.readFile("./public/index.html", "utf-8", function(error, text){ ..

Read more