Skip to content

Commit e89cc8e

Browse files
committed
Rename API server and add interceptor metadata
1 parent 987713e commit e89cc8e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const typeDefs = `
4444
type Interceptor {
4545
id: ID!
4646
version: String!
47+
metadata: Json
4748
4849
isActivable: Boolean!
4950
isActive(proxyPort: Int!): Boolean!
@@ -166,7 +167,7 @@ const buildResolvers = (
166167
}
167168
};
168169

169-
export class HttpToolkitServer extends events.EventEmitter {
170+
export class HttpToolkitServerApi extends events.EventEmitter {
170171

171172
private graphql: GraphQLServer;
172173

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Mutex } from 'async-mutex';
88

99
import updateCommand from '@oclif/plugin-update/lib/commands/update';
1010

11-
import { HttpToolkitServer } from './httptoolkit-server';
11+
import { HttpToolkitServerApi } from './api-server';
1212
import { checkBrowserConfig } from './browsers';
1313
import { reportError } from './error-tracking';
1414
import { delay, ALLOWED_ORIGINS } from './util';
@@ -101,15 +101,15 @@ export async function runHTK(options: {
101101
host: '127.0.0.1'
102102
});
103103

104-
// Start a HTK server
105-
const htkServer = new HttpToolkitServer({
104+
// Start the HTK server API
105+
const apiServer = new HttpToolkitServerApi({
106106
configPath,
107107
authToken: options.authToken,
108108
https: httpsConfig
109109
});
110110

111111
const updateMutex = new Mutex();
112-
htkServer.on('update-requested', () => {
112+
apiServer.on('update-requested', () => {
113113
updateMutex.runExclusive(() =>
114114
(<Promise<void>> updateCommand.run(['stable']))
115115
.catch((error) => {
@@ -129,7 +129,7 @@ export async function runHTK(options: {
129129
);
130130
});
131131

132-
await htkServer.start();
132+
await apiServer.start();
133133

134134
console.log('Server started in', Date.now() - certSetupTime, 'ms');
135135
console.log('Total startup took', Date.now() - startTime, 'ms');

0 commit comments

Comments
 (0)