from flask import Blueprint, render_template

from snakeeyes.extensions import redis


page = Blueprint('page', __name__, template_folder='templates')


@page.route('/')
def home():
    return render_template('page/home.html')


@page.route('/terms')
def terms():
    return render_template('page/terms.html')


@page.route('/privacy')
def privacy():
    return render_template('page/privacy.html')


@page.route('/up')
def up():
    redis.ping()
    return ''

from flask import Blueprint, render_template

from snakeeyes.extensions import redis


page = Blueprint('page', __name__, template_folder='templates')


@page.get('/')
def home():
    return render_template('page/home.html')


@page.get('/terms')
def terms():
    return render_template('page/terms.html')


@page.get('/privacy')
def privacy():
    return render_template('page/privacy.html')


@page.get('/up')
def up():
    redis.ping()
    return ''

Use new Flask 2.0 .get() decorator function
Use new Flask 2.0 .get() decorator function

  from flask import Blueprint, render_template
  
  from snakeeyes.extensions import redis
  
  
  page = Blueprint('page', __name__, template_folder='templates')
  
  
- @page.route('/')
+ @page.get('/')
  def home():
      return render_template('page/home.html')
  
  
- @page.route('/terms')
+ @page.get('/terms')
  def terms():
      return render_template('page/terms.html')
  
  
- @page.route('/privacy')
+ @page.get('/privacy')
  def privacy():
      return render_template('page/privacy.html')
  
  
- @page.route('/up')
+ @page.get('/up')
  def up():
      redis.ping()
      return ''
  
Use new Flask 2.0 .get() decorator function
## Code Before:
from flask import Blueprint, render_template

from snakeeyes.extensions import redis


page = Blueprint('page', __name__, template_folder='templates')


@page.route('/')
def home():
    return render_template('page/home.html')


@page.route('/terms')
def terms():
    return render_template('page/terms.html')


@page.route('/privacy')
def privacy():
    return render_template('page/privacy.html')


@page.route('/up')
def up():
    redis.ping()
    return ''

## Instruction:
Use new Flask 2.0 .get() decorator function
## Code After:
from flask import Blueprint, render_template

from snakeeyes.extensions import redis


page = Blueprint('page', __name__, template_folder='templates')


@page.get('/')
def home():
    return render_template('page/home.html')


@page.get('/terms')
def terms():
    return render_template('page/terms.html')


@page.get('/privacy')
def privacy():
    return render_template('page/privacy.html')


@page.get('/up')
def up():
    redis.ping()
    return ''
