text: from flask import Flask, jsonify, request, abort
  from bookDAO import bookDAO
  
  app = Flask(__name__, static_url_path='', static_folder='.')
  
  #app = Flask(__name__)
  
  #@app.route('/')
  #def index():
  #    return "Hello, World!"
  
  #curl "http://127.0.0.1:5000/books"
  @app.route('/books')
  def getAll():
      #print("in getall")
      results = bookDAO.getAll()
      return jsonify(results)
  
  #curl "http://127.0.0.1:5000/books/2"
  @app.route('/books/<int:id>')
  def findById(id):
      foundBook = bookDAO.findByID(id)
  
      return jsonify(foundBook)
  
  #curl  -i -H "Content-Type:application/json" -X POST -d "{\"Title\":\"hello\",\"Author\":\"someone\",\"Price\":123}" http://127.0.0.1:5000/books
  @app.route('/books', methods=['POST'])
  def create():
      
      if not request.json:
          abort(400)
      # other checking 
      book = {
          "Title": request.json['Title'],
          "Author": request.json['Author'],
          "Price": request.json['Price'],
      }
      values =(book['Title'],book['Author'],book['Price'])
      newId = bookDAO.create(values)
      book['id'] = newId
      return jsonify(book)
  
  #curl  -i -H "Content-Type:application/json" -X PUT -d "{\"Title\":\"hello\",\"Author\":\"someone\",\"Price\":123}" http://127.0.0.1:5000/books/1
  @app.route('/books/<int:id>', methods=['PUT'])
  def update(id):
      foundBook = bookDAO.findByID(id)
      if not foundBook:
          abort(404)
      
      if not request.json:
          abort(400)
      reqJson = request.json
      if 'Price' in reqJson and type(reqJson['Price']) is not int:
          abort(400)
  
      if 'Title' in reqJson:
          foundBook['Title'] = reqJson['Title']
      if 'Author' in reqJson:
          foundBook['Author'] = reqJson['Author']
      if 'Price' in reqJson:
          foundBook['Price'] = reqJson['Price']
      values = (foundBook['Title'],foundBook['Author'],foundBook['Price'],foundBook['idx'])
      bookDAO.update(values)
      return jsonify(foundBook)
          
  
  @app.route('/books/<int:id>' , methods=['DELETE'])
  def delete(id):
      bookDAO.delete(id)
      return jsonify({"done":True})
  
  
  
  
  if __name__ == '__main__' :
      app.run(debug= True)