Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mj52951 committed Nov 15, 2024
1 parent eef7d64 commit ef65c1f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY --from=builder /squid/node_modules ./node_modules
COPY --from=builder /squid/package*.json ./
COPY --from=builder /squid/lib ./lib
COPY --from=builder /squid/envs ./envs
LABEL org.opencontainers.image.source https://github.com/sygmaprotocol/sygma-explorer-indexer
LABEL org.opencontainers.image.source https://github.com/sygmaprotocol/squid-indexer
EXPOSE 8000

CMD ["node", "./lib/api/index.js"]
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ services:
build:
context: .
dockerfile: ./Dockerfile.api
depends_on:
- indexer-init
env_file: ./envs/.env.api
ports:
- "8000:8000"
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"node-cleanup": "^2.1.2",
"pg": "^8.11.5",
"typeorm": "^0.3.20",
"typeorm-fastify-plugin": "^2.0.1",
"winston": "^3.3.3",
"winston-transport": "^4.5.0"
},
Expand Down
18 changes: 3 additions & 15 deletions src/api/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,9 @@ export class App {
try {
await this.instance.ready();
logger.info(this.instance.printRoutes());
return new Promise((resolve, reject) => {
this.instance.listen(
{
port: this.instance.config.SERVER_PORT,
host: this.instance.config.SERVER_ADDRESS,
},
(error) => {
if (error) {
logger.error("Failed to start server: ", error);
reject();
}
resolve();
},
);
await this.instance.listen({
port: this.instance.config.SERVER_PORT,
host: this.instance.config.SERVER_ADDRESS,
});
} catch (error) {
logger.error("Error occurred during app startup: ", error);
Expand Down Expand Up @@ -97,7 +86,6 @@ export class App {
}

private async registerPlugins(): Promise<void> {
await this.instance.after();
await this.instance.register(fastifyCors, {
origin: this.instance.config.CORS_ORIGIN,
});
Expand Down

0 comments on commit ef65c1f

Please sign in to comment.