randomFree.js 565 B

12345678910111213141516171819202122
  1. const express = require('express');
  2. const router = express.Router();
  3. const randomFreeService = require('../../services/matchmaking/randomFree');
  4. const JSONError = require('../../helpers/index').JSONError;
  5. /* GET users listing. */
  6. router.get('/join', function(req, res, next) {
  7. console.log("HERE!");
  8. randomFreeService.join(req.user).
  9. then((data) => {
  10. console.log(data);
  11. console.log("Join Request!");
  12. res.send(data);
  13. }).
  14. catch((err) => {
  15. console.log(err);
  16. res.send(err);
  17. });
  18. });
  19. module.exports = router;