# Path: app.py



import os
import sys
from flask import request, Response
from flask import jsonify
from app import app
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Handling Accept Headers
    http://flask.pocoo.org/snippets/45/
"""

sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__))))




class Dummy(object):
    
    def to_json(self):
        return {'name': 'fsp'}


def get_items_from_database():
    for i in range(10):
        yield Dummy()


def request_wants_json():
    best = request.accept_mimetypes \
        .best_match(['application/json', 'text/html'])
    return best == 'application/json' and \
        request.accept_mimetypes[best] > \
        request.accept_mimetypes['text/html']



# Path: app.py



# Path: apis/handle_accept_header.py
import os
import sys
from flask import request, Response
from flask import jsonify
from app import app

    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Handling Accept Headers
    http://flask.pocoo.org/snippets/45/
"""

sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__))))




class Dummy(object):
    
    def to_json(self):
        return {'name': 'fsp'}


def get_items_from_database():
    for i in range(10):
        yield Dummy()


def request_wants_json():
    best = request.accept_mimetypes \
        .best_match(['application/json', 'text/html'])
    return best == 'application/json' and \
        request.accept_mimetypes[best] > \
        request.accept_mimetypes['text/html']



@app.route('/')