boilerplate for grpc

This commit is contained in:
iamBadgers
2025-06-08 00:31:24 -07:00
parent 2d81203398
commit 4f126594e5
6 changed files with 52 additions and 28 deletions

View File

@@ -1,13 +1,13 @@
import * as grpc from '@grpc/grpc-js'
import { Server, ServerCredentials } from '@grpc/grpc-js'
import { initCharacterService } from './character_service'
const port = 8000;
const port = 8000
const app = new grpc.Server()
const app = new Server()
initCharacterService(app)
app.bindAsync("0.0.0.0:8000", grpc.ServerCredentials.createInsecure(), () => {
console.log("Starting server at 0.0.0.0:8000")
})
app.bindAsync('0.0.0.0:8080', ServerCredentials.createInsecure(), () => {
console.log('Starting server at 0.0.0.0:8080')
})