Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions api_collections/Auth Collection.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"info": {
"_postman_id": "0b09db69-1448-4d54-83e7-5fb632f9204a",
"name": "Auth Collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "38366651"
},
"item": [
{
"name": "Signup",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"[email protected]\",\n \"username\": \"testuser\",\n \"password\": \"password123\"\n}"
},
"url": {
"raw": "{{baseUrl}}/auth/signup",
"host": ["{{baseUrl}}"],
"path": ["auth", "signup"]
}
},
"response": []
},
{
"name": "Signin",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const res = pm.response.json();",
"pm.environment.set(\"token\", res.token);",
"pm.environment.set(\"userId\", res.user._id);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"[email protected]\",\n \"password\": \"password123\"\n}"
},
"url": {
"raw": "{{baseUrl}}/auth/login",
"host": ["{{baseUrl}}"],
"path": ["auth", "login"]
}
},
"response": []
},
{
"name": "Get Profile",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{baseUrl}}/auth/me",
"host": ["{{baseUrl}}"],
"path": ["auth", "me"]
}
},
"response": []
},
{
"name": "Logout",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{baseUrl}}/auth/logout",
"host": ["{{baseUrl}}"],
"path": ["auth", "logout"]
}
},
"response": []
}
]
}
36 changes: 36 additions & 0 deletions api_collections/Comments Collection.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"info": {
"_postman_id": "173cf7c0-45ca-4771-9a6d-84203dcf9ee2",
"name": "Comments Collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "38366651"
},
"item": [
{
"name": "Get Comments",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/comments/{{movieId}}",
"host": ["{{baseUrl}}"],
"path": ["comments", "{{movieId}}"]
}
},
"response": []
},
{
"name": "Add Comments",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{baseUrl}}/comments/{{movieId}}",
"host": ["{{baseUrl}}"],
"path": ["comments", "{{movieId}}"]
}
},
"response": []
}
]
}
173 changes: 173 additions & 0 deletions api_collections/Messages Collection.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
"info": {
"_postman_id": "3c9fe6d9-c266-4276-89c4-6868d0401882",
"name": "Messages Collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "38366651"
},
"item": [
{
"name": "Get Messages",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Check status code\", function () {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"Response is an array\", function () {",
" const jsonData = pm.response.json();",
" pm.expect(jsonData).to.be.an('array');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/messages/",
"host": ["{{baseUrl}}"],
"path": ["messages", ""]
}
},
"response": []
},
{
"name": "Get Message By Id",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Check status code\", function () {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"Message has name and user\", function () {",
" const jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property(\"name\");",
" pm.expect(jsonData).to.have.property(\"user\");",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/messages/{{messageId}}",
"host": ["{{baseUrl}}"],
"path": ["messages", "{{messageId}}"]
}
},
"response": []
},
{
"name": "Add Messages",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Check status code\", function () {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"Message is returned with ID\", function () {",
" const jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property(\"_id\");",
" pm.environment.set(\"messageId\", jsonData._id);",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{baseUrl}}/messages/add/message",
"host": ["{{baseUrl}}"],
"path": ["messages", "add", "message"]
}
},
"response": []
},
{
"name": "Edit Message",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Check status code\", function () {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "PUT",
"header": [],
"url": {
"raw": "{{baseUrl}}/messages/edit/{{messageId}}",
"host": ["{{baseUrl}}"],
"path": ["messages", "edit", "{{messageId}}"]
}
},
"response": []
},
{
"name": "Delete Message",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Check status code\", function () {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"Deletion confirmation message\", function () {",
" const jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"Message deleted\");",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "{{baseUrl}}/messages/delete/{{messageId}}",
"host": ["{{baseUrl}}"],
"path": ["messages", "delete", "{{messageId}}"]
}
},
"response": []
}
]
}
Loading
Loading