Skip to content

Latest commit

 

History

History
74 lines (61 loc) · 1.08 KB

File metadata and controls

74 lines (61 loc) · 1.08 KB

aspnetcore-signalr-angular-devdays

A sample webchat application in ASP.NET Core with SignalR and Angular

Controller

Account Controller

Connect new user

POST /api/v1/account

Body Params :

    public IActionResult Post([FromBody] string username)

Response Success :

200 : User connected, return a json token
    {
        "access_token": "..."
    }

Response Error :

400 : Username is empty or validation failed
409 : User with this username already exist
    {
        "errorCode": 1,
        "message": "..."
    }

Get list of connected users

GET /api/v1/account

    public IActionResult Get()

Response Success :

200 : User connected
    {
        "users": [
            {
                "id": "00000000-0000-0000-0000-000000000000",
                "username": "..."
            }
        ]
    }

Response Error :

401 : Unauthorized, please connect first and use access token
    {
        "errorCode": 1,
        "message": "..."
    }

Hub

Chat Hub