From: karim hamidou Date: Fri, 13 Jul 2012 07:05:30 +0000 (+0200) Subject: serve file data X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=078f9ee686d9094613d3b6e7d536de93c023d51f;p=cagibi.git serve file data --- diff --git a/cagibi/server.py b/cagibi/server.py index d2c48a0..3701889 100644 --- a/cagibi/server.py +++ b/cagibi/server.py @@ -1,4 +1,4 @@ -from bottle import Bottle, route, run, post, get, put, delete, request, abort +from bottle import Bottle, route, run, post, get, put, delete, request, abort, static_file import os, time import json from config import load_config, save_config @@ -58,6 +58,10 @@ def delete_file(filename): def file_info(filename): return json.dumps(files_info[filename]) +@get('/files//data') +def file_data(filename): + return static_file(filename, root=cagibi_folder) + @post('/files//deltas') def return_deltas(filename): """return the deltas corresponding to the file. The client must send in its request the hashes of the file"""