Paste: some shit

Author: wuddup
Mode: factor
Date: Mon, 30 Nov 2015 19:52:00
Plain Text |
USING: accessors furnace.actions furnace.redirection
html.forms http http.server http.server.dispatchers
io.directories io.encodings.utf8 io.files io.pathnames
kernel math.parser multiline namespaces sequences urls
math ;
IN: webapps.imagebin

TUPLE: imagebin < dispatcher path n ;

: <uploaded-image-action> ( -- action )
    <page-action>
        { imagebin "uploaded-image" } >>template ;

: next-image-path ( -- path )
    imagebin get
    [ path>> ] [ [ 1 + ] change-n n>> number>string ] bi append-path ;

M: imagebin call-responder*
    [ imagebin set ] [ call-next-method ] bi ;

New Annotation

Summary:
Author:
Mode:
Body: