示例#1
0
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
示例#2
0
def add():
    server = request.get_json()
    new_server = NewServer()
    new_server.create_server(server)

    return {"message": "OK", "server name": server["server_name"]}
示例#3
0
async def add(server: Server):
    new_server = NewServer()
    new_server.create_server(dict(server))
    return {"message": "OK", "server name": server.server_name}