from flask import Flask, Response

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

@app.route('/<id>')
def example(id=None):
    resp = Response(id)
    resp.headers['Access-Control-Allow-Origin'] = 'http://localhost:3000'
    return resp

from flask import Flask, Response

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

@app.route('/search/<query>')
def example(query=None):
    resp = Response(id)
    resp.headers['Access-Control-Allow-Origin'] = 'http://localhost:3000'
    return resp

Add query capture in flask.
Add query capture in flask.

  from flask import Flask, Response
  
  app = Flask(__name__)
  
  @app.route('/')
  def hello_world():
      return 'Hello, World!'
  
- @app.route('/<id>')
+ @app.route('/search/<query>')
- def example(id=None):
+ def example(query=None):
      resp = Response(id)
      resp.headers['Access-Control-Allow-Origin'] = 'http://localhost:3000'
      return resp
  
Add query capture in flask.
## Code Before:
from flask import Flask, Response

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

@app.route('/<id>')
def example(id=None):
    resp = Response(id)
    resp.headers['Access-Control-Allow-Origin'] = 'http://localhost:3000'
    return resp

## Instruction:
Add query capture in flask.
## Code After:
from flask import Flask, Response

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

@app.route('/search/<query>')
def example(query=None):
    resp = Response(id)
    resp.headers['Access-Control-Allow-Origin'] = 'http://localhost:3000'
    return resp
