1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine the api, move the requests and errors to rest.

This commit is contained in:
winlin 2015-08-11 13:09:21 +08:00
parent c5bf397295
commit d761ebfa55
2 changed files with 30 additions and 14 deletions

View file

@ -800,17 +800,27 @@ int SrsServer::http_handle()
if ((ret = http_api_mux->handle("/api/v1/authors", new SrsGoApiAuthors())) != ERROR_SUCCESS) {
return ret;
}
if ((ret = http_api_mux->handle("/api/v1/requests", new SrsGoApiRequests())) != ERROR_SUCCESS) {
return ret;
}
if ((ret = http_api_mux->handle("/api/v1/vhosts", new SrsGoApiVhosts())) != ERROR_SUCCESS) {
return ret;
}
if ((ret = http_api_mux->handle("/api/v1/streams", new SrsGoApiStreams())) != ERROR_SUCCESS) {
return ret;
}
// for error test which always response error code 100.
if ((ret = http_api_mux->handle("/api/v1/errors", new SrsGoApiError())) != ERROR_SUCCESS) {
// test the request info.
if ((ret = http_api_mux->handle("/api/v1/test/requests", new SrsGoApiRequests())) != ERROR_SUCCESS) {
return ret;
}
// test the error code response.
if ((ret = http_api_mux->handle("/api/v1/test/errors", new SrsGoApiError())) != ERROR_SUCCESS) {
return ret;
}
// test the redirect mechenism.
if ((ret = http_api_mux->handle("/api/v1/test/redirects", new SrsHttpRedirectHandler("/api/v1/test/errors", SRS_CONSTS_HTTP_MovedPermanently))) != ERROR_SUCCESS) {
return ret;
}
// test the http vhost.
if ((ret = http_api_mux->handle("error.srs.com/api/v1/test/errors", new SrsGoApiError())) != ERROR_SUCCESS) {
return ret;
}