old_contents: import os
  
  from flask import Flask, request, Response, jsonify
  from flask import render_template, url_for, redirect, send_from_directory
  from flask import send_file, make_response, abort
  
  from angular_flask import app
  from angular_flask.models import Post
  
  """# routing for API endpoints, generated from the models designated as API_MODELS
  from angular_flask.core import api_manager
  from angular_flask.models import *
  
  for model_name in app.config['API_MODELS']:
      model_class = app.config['API_MODELS'][model_name]
      api_manager.create_api(model_class, methods=['GET', 'POST'])
  
  session = api_manager.session"""
  
  
  # routing for basic pages (pass routing onto the Angular app)
  @app.route('/')
  @app.route('/about')
  @app.route('/blog')
  def basic_pages(**kwargs):
      # return make_response(open('angular_flask/templates/index.html').read())
      return render_template('index.html')
  
  
  # Endpoint for all posts
  @app.route('/blog/api/posts')
  def get_posts():
      posts = Post.query.all()
      return jsonify(posts=[post.serialize for post in posts])
  
  
  # special file handlers and error handlers
  @app.route('/favicon.ico')
  def favicon():
      return send_from_directory(os.path.join(app.root_path, 'static'),
                                 'img/favicon.ico')
  
  
  @app.errorhandler(404)
  def page_not_found(e):
      return render_template('404.html'), 404
  
new_contents: import os
  
  from flask import Flask, request, Response, jsonify
  from flask import render_template, url_for, redirect, send_from_directory
  from flask import send_file, make_response, abort
  from sqlalchemy.orm.exc import NoResultFound
  
  from angular_flask import app
  from angular_flask.models import Post
  
  """# routing for API endpoints, generated from the models designated as API_MODELS
  from angular_flask.core import api_manager
  from angular_flask.models import *
  
  for model_name in app.config['API_MODELS']:
      model_class = app.config['API_MODELS'][model_name]
      api_manager.create_api(model_class, methods=['GET', 'POST'])
  
  session = api_manager.session"""
  
  
  # routing for basic pages (pass routing onto the Angular app)
  @app.route('/')
  @app.route('/about')
  @app.route('/blog')
  def basic_pages(**kwargs):
      # return make_response(open('angular_flask/templates/index.html').read())
      return render_template('index.html')
  
  
  # Endpoint for all posts
  @app.route('/blog/api/posts')
  def get_posts():
      posts = Post.query.all()
      return jsonify(posts=[post.serialize for post in posts])
  
  
  # get specific post
  @app.route('/blog/api/posts/<int:id>')
  def get_post(id):
      try:
          post = Post.query.filter_by(id=id).one()
          return jsonify(post=post.serialize)
      except NoResultFound:
          return render_template('404.html'), 404
  
  
  # special file handlers and error handlers
  @app.route('/favicon.ico')
  def favicon():
      return send_from_directory(os.path.join(app.root_path, 'static'),
                                 'img/favicon.ico')
  
  
  @app.errorhandler(404)
  def page_not_found(e):
      return render_template('404.html'), 404
  
subject: Add endpoint for single entry, plus handle error