Add applications

This commit is contained in:
2022-02-16 15:30:38 +01:00
parent 205adeb118
commit f35f277b16
10 changed files with 248 additions and 21 deletions

48
scripts/scratch.http Normal file
View File

@@ -0,0 +1,48 @@
POST http://localhost:8080/auth/register
Content-Type: application/json
{
"email": "some-user-email@gmail.com",
"password": "some-password"
}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 201, "response status is not 200")
})
client.test("Response content-type is json", function() {
const type = response.contentType.mimeType;
client.assert(type === "application/json", "Expected 'application/json' but received '" + type + "'");
});
%}
###
POST http://localhost:8080/projects/
Content-Type: application/json
Authorization: Basic some-user-email@gmail.com some-password
{
"name": "some-project-name"
}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 201, "response status is not 200")
})
client.test("Response content-type is json", function() {
var type = response.contentType.mimeType;
client.assert(type === "application/json", "Expected 'application/json' but received '" + type + "'");
});
%}
###
POST http://localhost:8080/applications/
Content-Type: application/json
Authorization: Basic some-user-email@gmail.com some-password
{
"projectId": 1,
"name": "some-application-name"
}