diff --git a/src/routes/root.ts b/src/routes/root.ts index 41b012e..fcc14a4 100644 --- a/src/routes/root.ts +++ b/src/routes/root.ts @@ -8,7 +8,6 @@ export const rootRoute = new Hono(); rootRoute.get("/", realIP, presentation, context => { // Move request to correct route const { port, ipAddress } = context.req.query(); - if (port) { if (ipAddress) { return context.redirect(`/${ipAddress}/${port}`); @@ -17,7 +16,10 @@ rootRoute.get("/", realIP, presentation, context => { } } + // Render index page + const userAgent = context.req.header("User-Agent"); return render(context, "index", { ip: context.get("ip"), + userAgent, }); }); diff --git a/templates/base.njk.html b/templates/base.njk.html index 87d7631..5106feb 100644 --- a/templates/base.njk.html +++ b/templates/base.njk.html @@ -29,9 +29,11 @@ background-color: #212126; width: 100%; max-width: 40em; - margin: 0 auto; + margin: 2em auto; border-radius: 1em; padding: 3em; + + overflow: scroll; } h2 { diff --git a/templates/index.njk.html b/templates/index.njk.html index ef7cd25..f985ade 100644 --- a/templates/index.njk.html +++ b/templates/index.njk.html @@ -76,6 +76,16 @@ Copy

+

+ Your User-Agent (Header): {{userAgent}} + +

+ Check if your port is reachable:
$ curl amiopen.now/<port>
@@ -102,12 +112,31 @@
 	
$ ssh hello@amiopen.now
{% endblock %} {% block scripts %} - {% endblock %}