make a webapp that shows you your ip
parent
d97ff8d94d
commit
7ab9af6a9e
|
@ -0,0 +1,16 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors furnace.actions http.server.dispatchers
|
||||
html.forms io.servers.connection namespaces prettyprint ;
|
||||
IN: webapps.ip
|
||||
|
||||
TUPLE: ip-app < dispatcher ;
|
||||
|
||||
: <display-ip-action> ( -- action )
|
||||
<page-action>
|
||||
[ remote-address get host>> "ip" set-value ] >>init
|
||||
{ ip-app "ip" } >>template ;
|
||||
|
||||
: <ip-app> ( -- dispatcher )
|
||||
ip-app new-dispatcher
|
||||
<display-ip-action> "" add-responder ;
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' ?>
|
||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||
<html>
|
||||
<body>Your IP address is: <t:label t:name="ip" />
|
||||
</body>
|
||||
</html>
|
||||
</t:chloe>
|
Loading…
Reference in New Issue