UNPKG

create-bodhi-node-boilerplate

Version:

Create a Node.js project with basic folder structure and server setup

196 lines (195 loc) 4.46 kB
{ "info": { "_postman_id": "unique-id", "name": "Bodhi Node Auth API", "description": "Collection for testing Bodhi Node.js Authentication API endpoints", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "variable": [ { "key": "baseUrl", "value": "http://localhost:7000", "type": "string" } ], "item": [ { "name": "Authentication", "item": [ { "name": "Register", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"username\": \"johndoe\",\n \"email\": \"john@example.com\",\n \"password\": \"password123\"\n}" }, "url": { "raw": "{{baseUrl}}/api/v1/auth/register", "host": ["{{baseUrl}}"], "path": ["api", "v1", "auth", "register"] } } }, { "name": "Login", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", "if (jsonData.data && jsonData.data.tokens) {", " pm.environment.set('accessToken', jsonData.data.tokens.accessToken);", " pm.environment.set('refreshToken', jsonData.data.tokens.refreshToken);", "}" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"email\": \"john@example.com\",\n \"password\": \"password123\"\n}" }, "url": { "raw": "{{baseUrl}}/api/v1/auth/login", "host": ["{{baseUrl}}"], "path": ["api", "v1", "auth", "login"] } } }, { "name": "Get Current User", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{accessToken}}" } ], "url": { "raw": "{{baseUrl}}/api/v1/auth/me", "host": ["{{baseUrl}}"], "path": ["api", "v1", "auth", "me"] } } }, { "name": "Refresh Token", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", "if (jsonData.data && jsonData.data.tokens) {", " pm.environment.set('accessToken', jsonData.data.tokens.accessToken);", "}" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"refreshToken\": \"{{refreshToken}}\"\n}" }, "url": { "raw": "{{baseUrl}}/api/v1/auth/refresh-token", "host": ["{{baseUrl}}"], "path": ["api", "v1", "auth", "refresh-token"] } } }, { "name": "Logout", "request": { "method": "POST", "header": [ { "key": "Authorization", "value": "Bearer {{accessToken}}" } ], "url": { "raw": "{{baseUrl}}/api/v1/auth/logout", "host": ["{{baseUrl}}"], "path": ["api", "v1", "auth", "logout"] } } } ] }, { "name": "User Management", "item": [ { "name": "Update Profile", "request": { "method": "PUT", "header": [ { "key": "Authorization", "value": "Bearer {{accessToken}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"username\": \"johndoe_updated\",\n \"email\": \"john.updated@example.com\"\n}" }, "url": { "raw": "{{baseUrl}}/api/v1/users/profile", "host": ["{{baseUrl}}"], "path": ["api", "v1", "users", "profile"] } } }, { "name": "Delete Account", "request": { "method": "DELETE", "header": [ { "key": "Authorization", "value": "Bearer {{accessToken}}" } ], "url": { "raw": "{{baseUrl}}/api/v1/users/account", "host": ["{{baseUrl}}"], "path": ["api", "v1", "users", "account"] } } } ] } ] }