I’m trying the rest api plugin for the first time… Im having problems getting started on a simple task of creating a custom url mapping. i dont have a portal. it should be on a web screen controller?
I dont know where to put this file? Do I have to create it on the beans.
I dont want queries or anything else just create a simple mapping and return a string
I added cuba.rest.anonymousEnabled = true
to test on the web-app.properties file.
package com.company.test.portal.myapi;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.company.test.services.SomeService;
@RestController
@RequestMapping("/myapi")
public class MyController {
@Inject
protected SomeService someService;
@GetMapping("/dosmth")
public String doSmth() {
return "HELLO"
}
}
I’d like to see the response on
localhost:8080/app/myapi/dosmth
thanks for the help