Skip to content

Cannot use "/" route? #452

@decentropy

Description

@decentropy

I am trying to use restx alongside a traditional flask route.
However, I cannot get the default "/" route to work.

Running code below...

How can I fix the 404, and handle root path?

from flask import Flask
from flask_restx import Api

app = Flask(__name__)

#restx api
api = Api(app, doc='/test/')

@app.route('/hi', methods=['GET'])
def home1():
    return 'hello'
    
@app.route('/', methods=['GET'])
def home2():
    return 'hello'

if __name__ == '__main__':
    app.run(debug=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions