So I have been tasked with the assignment of creating a nice overview web page using Kanbanik as the API. I am curious as to how I can add in the CORS headers. I have been tweaking the KanbanikAPI.scala but am having no luck, for some reason I feel that when I compile by running mvn clean install in terminal or by clicking the pom cleaning and installing through Eclipse and then running the application in Eclipse that the program is not actually recompiling and starting the server with the new .war file.
I was trying to do it myself by adding to the process function
private def process(req: HttpServletRequest, resp: HttpServletResponse) {
resp.setCharacterEncoding("UTF-8")
resp.addHeader("Access-Control-Allow-Origin", "*")
resp.addHeader("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, OPTIONS")
resp.addHeader("Access-Control-Allow-Headers","origin, access-control-allow-methods, content-type, access-control-allow-origin, access-control-allow-headers")
resp.addHeader("Access-Control-Max-Age", "1800")
The reason I think that it is not recompiling is because even if I add to the commandWithConfig area of process I get no changes when I make a post/get request to the api via postman
val commandWithConfig = commands.get(commandName)
if (!commandWithConfig.isDefined) {
respondAppError(ErrorDto("Incorrect command name: RECOMPILE! " + commandName), resp)
return
}
In postman I just get back "Incorrect command name: "
Thanks guys, I appreciate it!