{"size": 941, "ext": "js", "max_stars_repo_path": "main-server/routes/rooms.js", "max_stars_repo_name": "AVC0706/ExecuteIT", "max_stars_repo_stars_event_min_datetime": "2021-05-03T12:56:02.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-03T12:56:02.000Z", "max_issues_repo_path": "main-server/routes/rooms.js", "max_issues_repo_name": "AVC0706/ExecuteIT", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "main-server/routes/rooms.js", "max_forks_repo_name": "AVC0706/ExecuteIT", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.8518518519, "max_line_length": 130, "alphanum_fraction": 0.7077577046}
const express = require('express')
const router = express.Router()
const {jwtAuth} = require('../middlewares/auth')
const roomController = require('../controllers/room')

// @desc    Get rooms that user has joined or hosted
// @route   GET /rooms
router.get('/',jwtAuth,roomController.getRooms)

// @desc    Create a new room
// @route   POST /rooms
router.post('/', jwtAuth, roomController.spinDockerContainer)

// @desc    Join a new room using invite code
// @route   POST /rooms/join
router.post('/join',jwtAuth,roomController.joinRoom)

// @desc    Check if the room name is available
// @route   GET /rooms/checkRoomName
router.get('/checkRoomName',jwtAuth,roomController.checkRoomName)

// @desc    Get information of a particular room
// @route   GET /rooms/:inviteCode(uuid4)
router.get('/:inviteCode([0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12})',jwtAuth,roomController.getRoomInfo)

module.exports = router
