network: simply use ip instead of ipv4/ipv6
this makes it simpler for openapi docs
This commit is contained in:
@@ -101,15 +101,15 @@ async function setIPv6Config(req, res, next) {
|
||||
}
|
||||
|
||||
async function getIPv4(req, res, next) {
|
||||
const [error, ipv4] = await safe(network.getIPv4());
|
||||
const [error, ip] = await safe(network.getIPv4());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, { ipv4 }));
|
||||
next(new HttpSuccess(200, { ip }));
|
||||
}
|
||||
|
||||
async function getIPv6(req, res, next) {
|
||||
const [error, ipv6] = await safe(network.getIPv6()); // ignore any error
|
||||
const [error, ip] = await safe(network.getIPv6()); // ignore any error
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, { ipv6 }));
|
||||
next(new HttpSuccess(200, { ip }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user