Skip to content

Commit

Permalink
use host from an env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mathnogueira committed Aug 26, 2024
1 parent a09a9b6 commit c163dc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/src/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PokemonRpcService from './services/pokemonRpc.service';
import { setupSequelize } from './utils/db';

const { RPC_PORT = 8082 } = process.env;
const { RPC_HOST = `0.0.0.0:${RPC_PORT}` } = process.env

const startApp = async () => {
await setupSequelize();
Expand All @@ -12,7 +13,7 @@ const startApp = async () => {

server.addService(PokeshopService, PokemonRpcService);

server.bindAsync(`:${RPC_PORT}`, ServerCredentials.createInsecure(), error => {
server.bindAsync(RPC_HOST, ServerCredentials.createInsecure(), error => {
if (error) {
console.log(error)
}
Expand Down

0 comments on commit c163dc4

Please sign in to comment.