Skip to content

Commit

Permalink
feat: specify httpinboundtransport path (openwallet-foundation#1115)
Browse files Browse the repository at this point in the history
Signed-off-by: Niall Shaw <niall.shaw@absa.africa>
  • Loading branch information
niall-shaw authored and Artemkaaas committed Dec 5, 2022
1 parent fefbc34 commit 6dc5f39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/node/src/transport/HttpInboundTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ import express, { text } from 'express'
export class HttpInboundTransport implements InboundTransport {
public readonly app: Express
private port: number
private path: string
private _server?: Server

public get server() {
return this._server
}

public constructor({ app, port }: { app?: Express; port: number }) {
public constructor({ app, path, port }: { app?: Express; path?: string; port: number }) {
this.port = port

// Create Express App
this.app = app ?? express()
this.path = path ?? '/'

this.app.use(
text({
Expand All @@ -36,7 +38,7 @@ export class HttpInboundTransport implements InboundTransport {
port: this.port,
})

this.app.post('/', async (req, res) => {
this.app.post(this.path, async (req, res) => {
const session = new HttpTransportSession(utils.uuid(), req, res)
try {
const message = req.body
Expand Down

0 comments on commit 6dc5f39

Please sign in to comment.