A tiny “Whats my IP address” - service written in Lua, using the lua-http library. https://wmi.kokolor.es
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.
 
 
 

114 lines
4.1 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Whats my IP address?</title>
<meta name="description" content="A tiny whats-my-ip-address-service with a simple API, written in Lua.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="static/css/base-min.css">
<link rel="stylesheet" type="text/css" href="static/css/grids-min.css">
<link rel="stylesheet" type="text/css" href="static/css/grids-responsive-min.css">
<style>
.wmi-grid {
text-align: center;
}
.wmi-box {
margin: 20px;
}
.code-box {
text-align: left;
margin: 20px;
}
.ip {
border: 1px solid black;
border-radius: 15px;
font-size: 36px;
padding: 6px;
}
html, .pure-g [class *= "pure-u"] {
font-family: "Tahoma", "Geneva", sans-serif;
font-size: 18px;
}
body {
background-color: #f4b942;
margin-left: auto;
margin-right: auto;
max-width: 80%;
margin-bottom: 20px;
}
hr {
border-top: 1px solid black;
border-bottom: 1px solid black;
}
a:link { color: #000; }
a:visited { color: #000; }
</style>
</head>
<body>
<div class="wmi-grid">
<div class="pure-g">
<div class="pure-u-1">
<h2>hi!</h2>
<p>This is yet another whats-my-ip-address service. Soooo, here is your IP address:</p>
<p><code class="ip">{{ IP }}</code></p>
</div>
<div class="pure-u-1">
<h2>examples!</h2>
<p>Here you have some examples how you can use this service.</p>
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-3">
<div class="wmi-box">
<h3>JSON</h3>
<hr/>
<div class="code-box">
<pre>
$ curl -L {{ DOMAIN }}/json
}
"ip": {{ IP }}
}
</pre>
</div>
</div>
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-3">
<div class="wmi-box">
<h3>Plain</h3>
<hr/>
<div class="code-box">
<pre>
$ curl -L {{ DOMAIN }}
{{ IP }}
</pre>
</div>
</div>
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-3">
<div class="wmi-box">
<h3>More CLI examples</h3>
<hr/>
<div class="code-box">
<pre>
$ curl -L {{ DOMAIN }}
{{ IP }}
$ wget -qO- {{ DOMAIN }}
{{ IP }}
$ http --follow -b {{ DOMAIN }}
{{ IP }}
</pre>
</div>
</div>
</div>
<div class="pure-u-1">
<h2>credits!</h2>
<p>This little service is written in <a href="https://lua.org" target="_blank">Lua</a>, using the <a href="https://github.com/daurnimator/lua-http" target="_blank">lua-http</a> library and <a href="https://purecss.io/" target="_blank">Pure.CSS</a>.
You can find the source files on my <a href="https://git.kokolor.es/imo/whats-my-ip-address" target="_blank">Gitea instance</a>, <a href="https://codeberg.org/imo/whats-my-ip-address" target="_blank">Codeberg</a> or <a href="https://github.com/imolein/whats-my-ip-address" target="_blank">Github</a>.</p>
</div>
</div>
</div>
</body>
</html>