Web API¶
GOST can use the RESTful API to interact with the GOST process by starting the Web API service.
You can also start the API service only, and then dynamically configure services and other components through the API.
Path Prefix¶
The URL path prefix can be set via the pathPrefix
property.
For example, the default path is http://localhost:18080/config, when pathPrefix
is set to /api
, it becomes http://localhost:18080/api/config.
Access Log¶
Use the accesslog
property to enable the API access log. By default, no access log is output.
Authentication¶
Authentication uses HTTP Basic Auth.
Authentication information can be set through the auth
or auther
options. If the auther
option is set, the auth
option is ignored.
Online Test¶
You can use online environment to test, or try it directly in swaggerUI below. For API documentation, please refer to API Documentation.
The GOST program has built-in swagger API documentation. If the Web API service is enabled locally, you can also use https://api.gost.run/swagger-ui/?url=http://localhost:18080/docs/swagger.yaml to try to configure the local service (this assumes that the local Web API service is running on port 18080).
Switch Scheme
The default scheme in SwaggerUI is HTTPS. If you want to test local services, you need to manually switch to HTTP.