Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Set Micronaut Context Path

Tags:

micronaut

How does one go about setting a context path for a micronaut microservice? I want to do something similar to what is available in the Spring Framework where you can set the 'server.servlet.contextPath' property. I haven't been able to find anything in the micronaut docs here. I would like to set a base path for my microservice and my 'bar' controller (e.g. http://domain/foo/bar). In Spring this would look like

server:
  servlet:
    context-path: foo

I am currently using micronaut 1.0.0.M4. I appreciate the help.

like image 277
Clay Kirk Avatar asked Aug 13 '18 19:08

Clay Kirk


1 Answers

You can set the context path in the configuration with

micronaut:
  server:
    context-path: /my-path

Documentation: link

like image 183
pbthorste Avatar answered Oct 03 '22 18:10

pbthorste