{"size": 578, "ext": "js", "max_stars_repo_path": "app/routes/plants.server.routes.js", "max_stars_repo_name": "timsvoice/verdantree_mean", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/routes/plants.server.routes.js", "max_issues_repo_name": "timsvoice/verdantree_mean", "max_issues_repo_issues_event_min_datetime": "2015-04-08T21:37:11.000Z", "max_issues_repo_issues_event_max_datetime": "2015-04-08T21:37:52.000Z", "max_forks_repo_path": "app/routes/plants.server.routes.js", "max_forks_repo_name": "timsvoice/verdantree_mean", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 28.9, "max_line_length": 72, "alphanum_fraction": 0.723183391}
'use strict';

module.exports = function(app) {
	var users = require('../../app/controllers/users.server.controller');
	var plants = require('../../app/controllers/plants.server.controller');

	// Plants Routes
	app.route('/plants')
		.get(plants.list)
		.post(users.requiresLogin, plants.create);

	app.route('/plants/:plantId')
		.get(plants.read)
		.put(users.requiresLogin, plants.hasAuthorization, plants.update)
		.delete(users.requiresLogin, plants.hasAuthorization, plants.delete);

	// Finish by binding the Plant middleware
	app.param('plantId', plants.plantByID);
};
