def add(): server = request.get_json() new_server = NewServer() new_server.create_server(server) return {"message": "OK", "server name": server["server_name"]} # set server flask use # set FLASK_APP = {filename.py} # flask run => to run server
def add(): server = request.get_json() new_server = NewServer() new_server.create_server(server) return {"message": "OK", "server name": server["server_name"]}
async def add(server: Server): new_server = NewServer() new_server.create_server(dict(server)) return {"message": "OK", "server name": server.server_name}