Skip to content

Commit

Permalink
Change: fix env
Browse files Browse the repository at this point in the history
  • Loading branch information
Voktor Stolenets committed Dec 24, 2024
1 parent 136f815 commit 22ab2d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as dotenv from "dotenv";
dotenv.config();

export const HOST = process.env.HOST || "localhost";
export const PORT = Number(process.env.PORT || 3000);
export const DATABASE_URL =
process.env.DATABASE_URL || "mongodb://localhost:27017";
Expand Down
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const startServer = async () => {

fastify.post("/images", uploadHandler);

await fastify.listen({host: "0.0.0.0", port: PORT });
console.log(`Server running on http://${host}:${PORT}`);
await fastify.listen({ host: "0.0.0.0", port: PORT });
console.log(`Server running on http://${HOST}:${PORT}`);
} catch (error) {
fastify.log.error(error);
process.exit(1);
Expand Down

0 comments on commit 22ab2d5

Please sign in to comment.