Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying hostname for Hapi servers. #12

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export async function createServer(
* Creates Hapi server with thrift endpoint.
*/
const server: Hapi.Server = await createThriftServer({
address: HAPI_CALC_SERVER_STRICT_CONFIG.hostName,
port: HAPI_CALC_SERVER_STRICT_CONFIG.port,
path: HAPI_CALC_SERVER_STRICT_CONFIG.path,
thriftOptions: {
Expand Down
1 change: 1 addition & 0 deletions packages/thrift-integration/src/hapi-add-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export async function createServer(sampleRate = 0): Promise<Hapi.Server> {
* Creates Hapi server with thrift endpoint.
*/
const server: Hapi.Server = await createThriftServer({
address: ADD_SERVER_CONFIG.hostName,
port: ADD_SERVER_CONFIG.port,
path: ADD_SERVER_CONFIG.path,
thriftOptions: {
Expand Down
1 change: 1 addition & 0 deletions packages/thrift-integration/src/hapi-calculator-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export async function createServer(
* Creates Hapi server with thrift endpoint.
*/
const server: Hapi.Server = await createThriftServer({
address: HAPI_CALC_SERVER_CONFIG.hostName,
port: HAPI_CALC_SERVER_CONFIG.port,
path: HAPI_CALC_SERVER_CONFIG.path,
thriftOptions: {
Expand Down
1 change: 1 addition & 0 deletions packages/thrift-server-hapi/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function createThriftServer<TProcessor extends IThriftProcessor<Hapi.Requ
options: ICreateHapiServerOptions<TProcessor>
): Promise<Hapi.Server> {
const server = new Hapi.Server({
address: options.address,
port: options.port,
debug: { request: ['error'] },
})
Expand Down
3 changes: 2 additions & 1 deletion packages/thrift-server-hapi/src/main/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export interface IHapiPluginOptions<TProcessor extends IThriftProcessor<Hapi.Req

export interface ICreateHapiServerOptions<TProcessor extends IThriftProcessor<Hapi.Request>>
extends IHapiPluginOptions<TProcessor> {
port: number
address?: Hapi.ServerOptions['address']
port?: Hapi.ServerOptions['port']
}

export type ThriftHapiPlugin = Hapi.Plugin<void>