const app = require("express")(); app.get("/", async (req, res) => { fetch("https://api.my-ip.io/ip") .then(response => response.text()) .then(body => { res.send(`${body}`); }); }); const port = process.env.PORT || 8080; app.listen(port, () => console.log(`app listening on http://localhost:${port}`));