@jsenv/server 12.5.6 → 12.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/startServer.js +8 -0
package/package.json
CHANGED
package/src/startServer.js
CHANGED
|
@@ -728,12 +728,20 @@ export const startServer = async ({
|
|
|
728
728
|
`${serverName} started at ${serverOrigin} (${serverOrigins.external})`,
|
|
729
729
|
)
|
|
730
730
|
|
|
731
|
+
const addEffect = (callback) => {
|
|
732
|
+
const cleanup = callback()
|
|
733
|
+
if (typeof cleanup === "function") {
|
|
734
|
+
stopCallbackList.add(cleanup)
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
|
|
731
738
|
return {
|
|
732
739
|
getStatus: () => status,
|
|
733
740
|
origin: serverOrigin,
|
|
734
741
|
nodeServer,
|
|
735
742
|
stop,
|
|
736
743
|
stoppedPromise,
|
|
744
|
+
addEffect,
|
|
737
745
|
}
|
|
738
746
|
}
|
|
739
747
|
|