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

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