api/server.js
/*
	List menu by canteen via identifier string
*/
List menu by canteen via identifier string
List menu by canteen via identifier string
function respondCurrentMenuByMensa(req, res, next) {
	var lastSunday = moment().day("Sunday");
	var nextSunday = moment().day("Sunday").add(7, 'days');
	console.log('respondCurrentMenuByMensa:', req.params[0]);
	queryDatabase("SELECT data FROM menus WHERE data->>'date' > $1 AND data->>'date' <= $2 AND data->'mensa'->>'uid' ~ ($3||'$')", 
		[lastSunday.format("YYYY-MM-DD"), nextSunday.format("YYYY-MM-DD"), req.params[0]],
		function(response) {
		res.send( response.rows );
		next();
	});
}
function respondCurrentMenuByMensa ( req , res , next ) { var lastSunday = moment ( ) . day ( "Sunday" ) ; var nextSunday = moment ( ) . day ( "Sunday" ) . add ( 7 , 'days' ) ; console . log ( 'respondCurrentMenuByMensa:' , req . params [ 0 ] ) ; queryDatabase ( "SELECT data FROM menus WHERE data->>'date' > $1 AND data->>'date' <= $2 AND data->'mensa'->>'uid' ~ ($3||'$')" , [ lastSunday . format ( "YYYY-MM-DD" ) , nextSunday . format ( "YYYY-MM-DD" ) , req . params [ 0 ] ] , function ( response ) { res . send ( response . rows ) ; next ( ) ; } ) ; }
List menu by canteen via identifier string
List menu by canteen via identifier string
// query for current mensa food // concatenate query parameter with "$" to form a regular expression