Beispiel #1
0
def simple():
    if request.method == 'POST':
        f = request.files['content']
        if '/' in f.filename:
            abort(400)
        if config['overwrite'] == 'false' and dynamodb.exists(f.filename):
            abort(409)
        s3.upload(f.filename, f.stream)
        return '', 200
    db = boto3.resource('dynamodb')
    prefixes = dynamodb.list_packages(db)
    return render_template('simple.html', prefixes=prefixes, stage=config['stage'])
Beispiel #2
0
def simple():
    """
    The POST route only works locally since AWS API Gateway does not allow multi-part binary uploads
    """
    if request.method == 'POST':
        f = request.files['content']
        if '/' in f.filename:
            abort(400)
        if not config['overwrite'] and s3.exists(f.filename):
            abort(409)
        s3.upload(f.filename, f.stream)
        return ""
    db = boto3.resource('dynamodb')
    prefixes = dynamodb.list_packages(db)
    return render_template('simple.html',
                           prefixes=prefixes,
                           stage=config['stage'])
Beispiel #3
0
def simple():
    db = boto3.resource('dynamodb')
    prefixes = dynamodb.list_packages(db)
    return render_template('simple.html', prefixes=prefixes, stage=config['stage'])