
How
Configure the global API root path
此功能自:
Stay updated for more conveniences!
When designing APIs, we usually distinguish API resources from other server resources with a special prefix, for example:
{api}/{version}/{resources}/{resource_id}/action
api: The prefix for all API resources, such as /api.version: Version number, like v1, v100.resource: For instance, books related to books.resource_id: The ISBN of a book or your business ID, e.g., 1038DK-12.action: Such as get. You can also use HTTP methods like GET.Benefits of using a special prefix:
The API prefix is a global setting, so all APIs under the module will have the same prefix!
Update the configuration of your wire module
Project {module}-proto/main/resources/hope-wire.json:
{
"packageName" : "com.good.work",
"name" : "good-app-proto",
"application" : "good-app",
"domain" : "work",
"apiRoot" : "/api"
}
Add api root directory: "apiRoot" : "/api"
Update your SDK version
Project /gradle/libs.versions.toml:
# libraries
apihug = "1.1.8-RELEASE"
Please update the IDEA plugin to 0.6.5+ to enjoy configuration and debugging in the UI!