package nl.tuvok.elobeggers.controllers;

import static spark.Spark.*;
import static nl.tuvok.elobeggers.JsonUtil.*;

import nl.tuvok.elobeggers.services.UserService;
import spark.Route;

public class UserController {
	public UserController(final UserService userService) {
		get("/users", (req, res) -> userService.getAllUsers(), json());

		get("/users", new Route() {
			@Override
			public Object handle(spark.Request request, spark.Response response) throws Exception {
				return userService.getAllUsers();
			}
		});
		post("/user", new Route() {
			@Override
			public Object handle(spark.Request request, spark.Response response) throws Exception {
				return userService.createUser("test", "test@test.nl");
			}
		});
		// more routes
	}
}
@@ -334,16 +334,18 @@
 on());%0A%0A
+//
 %09%09get(%22/
@@ -358,32 +358,34 @@
 , new Route() %7B%0A
+//
 %09%09%09@Override%0A%09%09%09
@@ -373,32 +373,34 @@
 %0A//%09%09%09@Override%0A
+//
 %09%09%09public Object
@@ -466,32 +466,34 @@
 ows Exception %7B%0A
+//
 %09%09%09%09return userS
@@ -514,21 +514,25 @@
 sers();%0A
+//
 %09%09%09%7D%0A
+//
 %09%09%7D);%0A%09%09
@@ -730,16 +730,24 @@
 %09%09%09%7D%0A%09%09%7D
+, json()
 );%0A%09%09// 

Return json on post