Skip to content
Snippets Groups Projects

Resolve "matchSalamander endpoint"

Merged Herman Andersen Dyrkorn requested to merge 1-matchsalamander-endpoint into master
+ 11
10
# This is a sample Python script.
from flask import Flask
from flask_restful import Api, Resource
# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
app = Flask(__name__)
api = Api(app)
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint.
class MatchSalamander(Resource):
@staticmethod
def post():
return {"data": "salamander"}
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')
api.add_resource(MatchSalamander, "/matchSalamander")
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
if __name__ == "__main__":
app.run(debug=True)
Loading