Skip to content

Commit 7677f93

Browse files
committed
Update mockttp for standalone error handling & CORS fixes
1 parent aabb9d3 commit 7677f93

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"iconv-lite": "^0.4.24",
5656
"lodash": "^4.17.19",
5757
"mime-types": "^2.1.27",
58-
"mockttp": "^1.0.1",
58+
"mockttp": "^1.0.2",
5959
"node-fetch": "^2.6.0",
6060
"node-forge": "^0.9.1",
6161
"node-gsettings-wrapper": "^0.5.0",

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,14 @@ export async function runHTK(options: {
8888
maxAge: 86400 // Cache CORS responses for as long as possible
8989
}
9090
});
91-
standalone.start({
91+
await standalone.start({
9292
port: 45456,
9393
host: '127.0.0.1'
9494
});
9595

96+
const standaloneSetupTime = Date.now();
97+
console.log('Standalone server started in', standaloneSetupTime - certSetupTime, 'ms');
98+
9699
// Start the HTK server API
97100
const apiServer = new HttpToolkitServerApi({
98101
appName: APP_NAME,
@@ -124,6 +127,6 @@ export async function runHTK(options: {
124127

125128
await apiServer.start();
126129

127-
console.log('Server started in', Date.now() - certSetupTime, 'ms');
130+
console.log('Server started in', Date.now() - standaloneSetupTime, 'ms');
128131
console.log('Total startup took', Date.now() - startTime, 'ms');
129132
}

0 commit comments

Comments
 (0)