Commenting-Server/src/main/java/net/mindoverflow/comments/webapp/WebServer.java

29 lines
1012 B
Java

package net.mindoverflow.comments.webapp;
import net.mindoverflow.comments.webapp.controllers.CommentController;
import net.mindoverflow.comments.webapp.controllers.CommentsController;
import net.mindoverflow.comments.webapp.controllers.LoginController;
import net.mindoverflow.comments.webapp.controllers.RegisterController;
import ro.pippo.controller.ControllerApplication;
import ro.pippo.core.route.TrailingSlashHandler;
import java.util.HashMap;
public class WebServer extends ControllerApplication
{
public static final HashMap<String, String> userAndPassword = new HashMap<>();
public static final HashMap<String, String> jwtAndUser = new HashMap<>();
public static final HashMap<String, String> userAndComment = new HashMap<>();
@Override
public void onInit()
{
addControllers(new LoginController(), new RegisterController(), new CommentsController(), new CommentController());
ANY("/.*", new TrailingSlashHandler(false)); // remove trailing slash
}
}