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

server.js 410B

7 years ago
123456789101112131415161718192021
  1. var web = require("webstuff");
  2. var play = require("./js/play");
  3. var app = web();
  4. play.init(app);
  5. app.express.use((req, res, next) => {
  6. if (req.url === "/" && play.isPlaying())
  7. res.redirect("/playback");
  8. else
  9. next();
  10. });
  11. app.static("web");
  12. app.post("/plaything", (req, res) => {
  13. play.playFile("/home/martin/Documents/Assassination Classroom - E01.mkv", () => {
  14. res.redirect("/playback");
  15. });
  16. });