import sys


if __name__ == '__main__':
    with open('/dev/input') as input_fp:
        with open('/dev/output', 'a') as output_fp:
            output_fp.write(input_fp.read())

    msg = 'Zapp registered!'
    resp = """\
    HTTP/1.1 201 Created
    Content-Type: message/http
    Content-Length: %(msg_len)s

    %(msg)s"""
    resp %= dict(msg=msg, msg_len=len(msg))
    sys.stdout.write(resp)
