@servable/server
Version:
Servable server
27 lines (23 loc) • 500 B
JavaScript
import getPortNear from "../../../../utils/ports/getPortNear.js"
export default async (props) => {
const {
port,
protocol,
} = props
const { mode, published, target } = port
try {
const publishedInt = parseInt(published)
const _published = await getPortNear({
port: publishedInt,
maxRange: 1000
})
return {
...port,
published: _published,
requestedPublished: publishedInt
}
} catch (e) {
console.error(e)
}
return port
}