Hi,
I am using Springboot as my backend and inside the code there are some API endpoints such as
localhost:8080/latestDocuments301
where it will run the query
SELECT eg FROM table eg
WHERE eg.libraryId = 301
AND eg.publish = 2
ORDER BY eg.publicationDate DESC
LIMIT 5
I am planning to migrate to JMIX and use its REST API add on to expose the JMIX application. Is there any way that i can use the same endpoint i.e. /latestDocuments301 and map it to JMIX REST API endpoint or do I need to do a complete overhaul of all the endpoints in my Springboot. Thank you.
Of course you can use custom endpoints together with Jmix generic REST.
For example, if you have the following REST controller:
@RestController
public class DocumentController {
@GetMapping("/countLatestDocuments")
public int countLatestDocuments() {
return 42;
}
}
you can secure it with the same token-based authentication mechanism as generic REST if you add its URL to the jmix.resource-server.authenticated-url-patterns property:
If you want to access this endpoint without authentication (i.e. as anonymous system user), add the URL to jmix.resource-server.anonymous-url-patterns property: