Skip to content

Commit

Permalink
Refactor Express module initialization: remove unnecessary promise in…
Browse files Browse the repository at this point in the history
… init method and update Server class to call init without await
  • Loading branch information
jthoward64 committed Jan 17, 2025
1 parent 1519134 commit 6017c87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions packages/server/src/entry/server/Express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,11 @@ export class ExpressModule {
private readonly cookieSecret: string
) {}

async init(): Promise<void> {
init() {
this.#app = express();
this.#app.set("trust proxy", true);

this.#httpServer = http.createServer(this.app);

// eslint-disable-next-line unicorn/no-useless-promise-resolve-reject
return Promise.resolve();
}

public startMiddlewares() {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/entry/server/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Server implements EntryPoint {
`Logger initialized with level "${this.loggingLevel}", writing log files to "${this.logDir}"`
);

await this.expressModule.init();
this.expressModule.init();
await this.apolloModule.init();

this.expressModule.startMiddlewares();
Expand Down

0 comments on commit 6017c87

Please sign in to comment.