Created
April 7, 2018 02:53
-
-
Save aarshtalati/ae59be09a5d55386dceac9579f148e59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics.controller; | |
import edu.gatech.epidemics.viewmodel.Login; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.*; | |
/** | |
* @author atalati | |
*/ | |
@Controller | |
public class HomeController { | |
@PostMapping(value = "/") | |
public final String post(@RequestBody Login loginInput) { | |
System.out.println("HTTP POST: \"/api/login/\" : " + loginInput.toString()); | |
if (loginInput.getUsername() == "aarsh" && loginInput.getPassword() == "test") { | |
return "redirect:/home"; | |
} else { | |
return "redirect:/"; | |
} | |
} | |
@GetMapping(value = "/") | |
public String get() { | |
System.out.println("index"); | |
return "index"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment