A sample webchat application in ASP.NET Core with SignalR and Angular
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 /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": "..."
}