I think it would be nice to be able to specify a prefix as an annotation without using pathPrefix.
For example.
ServerBuilder sb = new ServerBuilder();
sb.annotatedService(new ForBarService());
//...
@PathPrefix("/foo")
public class FooBarService {
@Get
@Path("/bar")
public Object bar() { ... }
@Get
public Object fooGet() { ... }
@Post
public Object fooPost() { ... }
}
I think there is an advantage to see the specified path at once.
That's a good idea. We currently use @Path for other type of path mappings such as glob and regex, so we have two options:
@Path when it's used at class level.@PathPrefix.I prefer the second option, but what do you think? /cc @ikhoon @minwoox
I think @Path at class level could make a user confused because of the glob. I also lean to @PathPrefix, furthermore we can use it method level too. 馃榾
+1 for @PathPrefix :)
Hi, Is this something a first timer can work on? If yes, I'm more that happy to look at it. I think I could read value inside @PathPrefix("/pathPrefix") in here https://github.com/line/armeria/blob/883826f08f3634151b940102404be514fa88fb34/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java#L274 and use the read value if the exiting pathPrefix value is /.
@sivaalli Thanks for your interest!
Yes, I think and I hope it's not that difficult. But I think we need to ask @heowc that he is going to deal with this or not before you take this. 馃槈
@sivaalli Thanks for your opinion!
I will another PRs in progress and someday I will proceed this.
but, if you need to this, I think it's not bad for you to deal with it. 馃憤
Thanks you @minwoox and @heowc for your thoughts. I will work on this. BTW excellent work creating armeria and open sourcing it.
Most helpful comment
@sivaalli Thanks for your opinion!
I will another PRs in progress and someday I will proceed this.
but, if you need to this, I think it's not bad for you to deal with it. 馃憤