Test of Aqueduct, a dart framework to host a multi-threaded http server.
$ pub global activate aqueduct
$ pub get
$ pub run aqueduct serve
Server running in
http://localhost:8888
[GET] /api/user
When error: Status Code 404
When success: Status Code 200
{
"body": [
{
"_id": "ObjectId(\"5eb833f9d88ad3aaa371f11d\")",
"name": "Foo bar"
}
]
}
[GET] /api/user/{UserObjectId}
When error: Status Code 404
When success: Status Code 200
{
"_id": "ObjectId(\"5eb833f9d88ad3aaa371f11d\")",
"name": "Foo bar"
}
[POST] /api/user/{UserObjectId}
To update, send user data in body request (JSON):
{
"name": "Update my Name plz"
}
When error: Status Code 500
When success: Status Code 200
{
"success": true
}
[POST] /api/user
To insert new user, send user data in body request (JSON):
{
"name": "Foo bar"
}
When error: Status Code 500
When success: Status Code 200
{
"success": true
}
[DELETE] /api/user/{UserObjectId}
When error: Status Code 500
When success: Status Code 200
{
"success": true
}