summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hero.mjs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hero.mjs b/src/hero.mjs
index 40d3b0d..a51d5c0 100644
--- a/src/hero.mjs
+++ b/src/hero.mjs
@@ -414,6 +414,13 @@ export const buildRoutes = (routes, globalInterceptors = []) =>
{}
);
+export const buildTable = (routes, globalInterceptors = []) =>
+ u.assocIn(
+ buildRoutes(routes, globalInterceptors),
+ ["interceptors"],
+ globalInterceptors,
+ );
+
export const promisifyServer = (name, serverHandle, socket, pipe) => {
let closePipeFn = null;
return {
@@ -445,7 +452,7 @@ export const buildServer = ({
pipe = `${name}.pipe`,
globalInterceptors = defaultInterceptors,
}) => {
- const table = buildRoutes(routes, globalInterceptors);
+ const table = buildTable(routes, globalInterceptors);
const requestListener = makeRequestListener(table);
const server = http.createServer(requestListener);
return promisifyServer(name, server, socket, pipe);