You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
510 B
14 lines
510 B
1 year ago
|
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 style="background: slategray; color: white; font-family: sans-serif; font-weight: bold; font-size: 4em; height: 100vh; display: flex; align-items: center; justify-content: center;">${body}</body>`);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
const port = process.env.PORT || 8080;
|
||
|
|
||
|
app.listen(port, () => console.log(`app listening on http://localhost:${port}`));
|