Skip to content

Commit e082493

Browse files
committed
Define a detailed-metadata-only REST API endpoint
1 parent 385d539 commit e082493

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/api/rest-api.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,13 @@ export function exposeRestAPI(
5353
res.send({ interceptors: await apiModel.getInterceptors(proxyPort) });
5454
}));
5555

56-
// Get full detailed data on a specific interceptor state, i.e. detailed metadata.
57-
server.get('/interceptors/:id', handleErrors(async (req, res) => {
56+
// Get the complete details of a specific interceptor state, i.e. full metadata.
57+
// This may return more detailed info that the 'metadata' field on getInterceptors
58+
server.get('/interceptors/:id/metadata', handleErrors(async (req, res) => {
5859
const interceptorId = req.params.id;
59-
const proxyPort = getProxyPort(req.query.proxyPort);
6060

6161
res.send({
62-
interceptors: await apiModel.getInterceptor(interceptorId, {
63-
proxyPort: proxyPort,
64-
metadataType: 'detailed'
65-
})
62+
interceptorMetadata: await apiModel.getInterceptorMetadata(interceptorId, 'detailed')
6663
});
6764
}));
6865

0 commit comments

Comments
 (0)