My route specifies:
exports.install = function (framework) {
framework.route('/', view_homepage);
framework.route('/CreateRoom', redirect_createroom);
framework.route('/Room', redirect_homepage);
framework.route('/Room/(roomId)[0-9]{5}', view_room);
};
Specifically this:
framework.route('/Room/(roomId)[0-9]{5}', view_room);
This is made up and I am sure not the correct syntax. I looked at the documentation but did not find a solution or it wasn't obvious to me.
But what I am trying to do is get the 5-digit value after 'Room/' into a variable called roomId and then passed to the controller view_room.
Any help implementing this would be great.
Thanks
E.
I think what you can do is framework.route('/Room/{roomId}', view_room);
The function could look like this:
function view_room (roomId){
if(!success) { //input check
//response with 404 - resource not found
} else {
//do work
}
}