backup
This commit is contained in:
1 parent
95193bc3f3
commit
ee602ee891
4 files changed
+20
-5
No files matched your search
@@ -40,3 +40,11 @@ app.use("/pcb_panel_bom", pcbPanelRoute);
|
|||||||
server.listen(PORT, function () {
|
server.listen(PORT, function () {
|
||||||
console.log(`Server started on port ${PORT}...`);
|
console.log(`Server started on port ${PORT}...`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
function myFunc(arg) {
|
||||||
|
// io.emit("test", arg);
|
||||||
|
io.emit("test", i);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
// setInterval(myFunc, 1500, i);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
console.log("starting");
|
window.addEventListener("load", function () {
|
||||||
fetch("http://localhost:3000/flasher/getProjects", {
|
fetch("http://localhost:3000/flasher/getProjects", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: "body",
|
body: "body",
|
||||||
@@ -8,14 +8,17 @@ fetch("http://localhost:3000/flasher/getProjects", {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
console.log("hello world");
|
|
||||||
console.log(res);
|
console.log(res);
|
||||||
location.reload();
|
|
||||||
})
|
})
|
||||||
.catch((err) => ("Error occured", err));
|
.catch((err) => ("Error occured", err));
|
||||||
|
});
|
||||||
|
|
||||||
var socket = io();
|
var socket = io();
|
||||||
|
|
||||||
|
socket.on("test", (s) => {
|
||||||
|
console.log(s);
|
||||||
|
});
|
||||||
|
|
||||||
form.addEventListener("submit", function (e) {
|
form.addEventListener("submit", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (input.value) {
|
if (input.value) {
|
||||||
|
|||||||
@@ -23,12 +23,16 @@ const router = express.Router();
|
|||||||
router.post("/getProjects", function (req, res, next) {
|
router.post("/getProjects", function (req, res, next) {
|
||||||
console.log("yes there is a request");
|
console.log("yes there is a request");
|
||||||
var io = req.app.get("io");
|
var io = req.app.get("io");
|
||||||
io.emit("world", "This will emit projects");
|
io.emit("test", "This will emit projects");
|
||||||
|
io.emit("test", "Hello from socket");
|
||||||
// io.to(//socket.id//).emit("message", data);
|
// io.to(//socket.id//).emit("message", data);
|
||||||
|
|
||||||
// db.rides.find(function(err, docs) {
|
// db.rides.find(function(err, docs) {
|
||||||
// res.json(docs);
|
// res.json(docs);
|
||||||
// });
|
// });
|
||||||
|
res.setHeader("content-type", "text/html; charset=utf-8");
|
||||||
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
res.send("ok you got it back");
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get("/", function (req, res) {
|
router.get("/", function (req, res) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ block content
|
|||||||
.input-group
|
.input-group
|
||||||
.input-group-prepend
|
.input-group-prepend
|
||||||
span.input-group-text(id='') Device Id
|
span.input-group-text(id='') Device Id
|
||||||
input.form-control(type='text',id="in-id")
|
input.form-control(type='text',id="in-id",placeholder="Please input your device id")
|
||||||
.input-group-append
|
.input-group-append
|
||||||
button#getkeybtn.btn.btn-outline-secondary.disabled(type="button", onclick="clickme()") Get Keys
|
button#getkeybtn.btn.btn-outline-secondary.disabled(type="button", onclick="clickme()") Get Keys
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user