You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
654 B
JavaScript

const express = require("express");
const router = express.Router();
router.post("/getProjects", function (req, res, next) {
console.log("yes there is a request");
var io = req.app.get("io");
io.emit("test", "This will emit projects");
io.emit("test", "Hello from socket");
// io.to(//socket.id//).emit("message", data);
// db.rides.find(function(err, 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) {
res.render("flasher");
});
module.exports = router;