0

I am trying to get used to flask but I want to basically create a custom endpoint.

For example: given a website is called: abc.com I basically want to create an endpoint: abc.com/me which would then print something like "HI"

deeformvp
  • 157
  • 1
  • 2
  • 11

1 Answers1

0

if I understand you correctyly, this peace of code is what you want to do. When you run the code servers up and run on the localhost:5000 in default port, if you route localhost:5000/me page shows hi. also read documantation

from flask import Flask

app = Flask(__name__)

@app.route('/me') 
def me():
    return 'Hi'

if __name__ == '__main__':
    app.run()
umit.kas
  • 125
  • 2
  • 8