Open
Description
If a API gateway has a configuration using autoAliases, the service will be marker as "ready" (started) even if the routes are not registered yet:
name: "xyz",
routes: [{
path: "/download",
use: [cookieparser()],
whitelist: ["xyz.download"],
autoAliases: true,
mappingPolicy: "restrict",
logging: false,
}]
...
actions: {
xyz: {
rest: {
method: "POST",
path: "/"
},
...
}
}
If this syntax is used, it works as intended:
name: "xyz",
routes: [{
path: "/download",
use: [cookieparser()],
whitelist: ["xyz.download"],
aliases: {
"POST /": "xyz.download"
}
mappingPolicy: "restrict",
logging: false,
}]
...
actions: {
download: {
rest: {
method: "POST",
path: "/"
},
...
}
}
this test will randomly fail for the first case:
describe("test", () => {
beforeAll(async () => {
broker.createService(xyzService);
await broker.start();
await broker.waitForServices(["xyz"]);
});
// test to request /download
});
Metadata
Metadata
Assignees
Labels
No labels