I want to return either IPv4/IPv6 IP in the loopback4 application? How do I modify the below code to get IP address?
import {get, param} from '@loopback/rest';
export class GreetController {
@get('/', {
responses: {
'200': {
description: 'greeting text',
content: {
'application/json': {
schema: {type: 'string'},
},
},
},
},
})
greet(@param.query.string('name') name: string) {
return `hello ${name}`;
}
}