0

When I try to rewrite Katharsis self link, I need add resource url as prefix.

e.g: "self": "http://localhost/table-name/A" Where I can get http://localhost/table-name.

I found ResourceRegistry provider this method. but I am not able to get ResourceRegistry instance。 Is any good way to get ResourceUrl ?

ResourceRegistry
 public String getResourceUrl(Class<?> clazz) 
Bensson
  • 4,509
  • 4
  • 19
  • 24

1 Answers1

0

The localhost part will be picked up from the host header. The prefix can be set in your application properties file. I think it's literally called api.prefix. If you want to override the local host part programmatically you can implement a bean of type

ServiceUrlProvider and declare it @Primary

Look at the spring boot example config

Christian Bongiorno
  • 5,150
  • 3
  • 38
  • 76