adjust index file
This commit is contained in:
parent
e13d26f8c1
commit
d5e92d075e
30
index.ts
30
index.ts
@ -3,11 +3,31 @@ import { logger } from "./logger";
|
|||||||
|
|
||||||
const port = app.get("port");
|
const port = app.get("port");
|
||||||
const host = app.get("host");
|
const host = app.get("host");
|
||||||
|
const server = app.listen(port);
|
||||||
process.on("unhandledRejection", (reason) =>
|
|
||||||
logger.error("Unhandled Rejection %O", reason),
|
|
||||||
);
|
|
||||||
|
|
||||||
app.listen(port).then(() => {
|
app.listen(port).then(() => {
|
||||||
logger.info(`Feathers app listening on http://${host}:${port}`);
|
logger.info(`Walias app listening on http://${host}:${port}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on("SIGINT", () => {
|
||||||
|
logger.info("Received SIGINT signal. Shutting down gracefully.");
|
||||||
|
|
||||||
|
server.close(() => {
|
||||||
|
logger.info("HTTP server closed.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on("SIGTERM", () => {
|
||||||
|
logger.info("Received SIGTERM signal. Shutting down gracefully.");
|
||||||
|
|
||||||
|
server.close(() => {
|
||||||
|
logger.info("HTTP server closed.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on("unhandledRejection", (reason) => {
|
||||||
|
logger.error("Unhandled rejection", reason);
|
||||||
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
@ -117,7 +117,10 @@ export class AliasesService<ServiceParams extends AliasesParams = AliasesParams>
|
|||||||
const allowedDomain: string = config.get("wildDuck.domain");
|
const allowedDomain: string = config.get("wildDuck.domain");
|
||||||
|
|
||||||
// If address does not match the allowed domain, throw an error
|
// If address does not match the allowed domain, throw an error
|
||||||
if (!allowedDomain || !addressInfoResponse.address.endsWith(allowedDomain)) {
|
if (
|
||||||
|
!allowedDomain ||
|
||||||
|
!addressInfoResponse.address.endsWith(allowedDomain)
|
||||||
|
) {
|
||||||
throw new BadRequest("Unable to delete address");
|
throw new BadRequest("Unable to delete address");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user