1

Problem

Why Jhipster adds "/api" in the Request Mapping when I generate Monolithic Application and why it names controller as a resource?

For Example,See below

@RequestMapping("/api")
public class MenuResource {

Is it a standard process because when I was making rest api's without using jhipster and if I add "api" and someone asks why you have added this API.

Solution

I tried finding by googling it but I can only find this URL which I am unable to understand?

https://github.com/jhipster/generator-jhipster/issues/2954

Can anyone guide me about the same.Thanks in advance.

TheSprinter
  • 1,523
  • 17
  • 30

1 Answers1

2

"Resource" comes from REST naming see What are REST resources? . /api is just a convention to group all your REST endpoints and to avoid name collisions with non REST URLs that could be served by your app. It's also a convention that is used by JHipster microservices architecture for routing and access control.

Gaël Marziou
  • 16,028
  • 4
  • 38
  • 49
  • Marziou Can you explain some use case or an example of some non REST URLs and microservice routing and access points. For Example, SOAP web services I think are an example of non-rest URL's and we don't use it usually – jalaj chawla Dec 18 '18 at 10:20
  • 1
    index.html, javascript bundles, css, images, error pages, h2-console, swagger-ui, actuator endpoints – Gaël Marziou Dec 18 '18 at 12:48