diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..5827129 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +POSTGRES_URL=postgresql://user:password@your-host:5432/database +ALLNET_PORT=20080 +MUCHA_PORT=10082 +SERVICE_PORT=9002 +API_PORT=9003 \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 9eae0ca..09e7c19 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,10 +27,12 @@ export const prisma = new PrismaClient(); const appRouter = Router(); -const PORT_ALLNET = 80; -const PORT_MUCHA = 10082; -const PORT_BNGI = 9002; -const PORT_API = 9003; +console.log(process.env); + +const PORT_ALLNET = process.env.ALLNET_PORT !== undefined ? parseInt(process.env.ALLNET_PORT) : 80; +const PORT_MUCHA = process.env.MUCHA_PORT !== undefined ? parseInt(process.env.MUCHA_PORT) : 10082; +const PORT_BNGI = process.env.SERVICE_PORT !== undefined ? parseInt(process.env.SERVICE_PORT) : 9002; +const PORT_API = process.env.API_PORT !== undefined ? parseInt(process.env.API_PORT) : 9003; const app = express(); const muchaApp = express();