1
0
mirror of synced 2024-11-12 01:10:47 +01:00

Add support for changing the port

This commit is contained in:
Luna 2022-11-19 15:41:05 +00:00
parent 804fcee27a
commit 6c45b72512
2 changed files with 11 additions and 4 deletions

5
.env.example Normal file
View File

@ -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

View File

@ -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();