From 8829c1eee38ba32730896a269eadf2631e26db05 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 2 Jun 2025 00:11:34 +0200 Subject: Add shortcut for generating http file, part of API documentation --- endpoints.http | 86 +++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 13 deletions(-) (limited to 'endpoints.http') diff --git a/endpoints.http b/endpoints.http index 93a4b53..b9a1238 100644 --- a/endpoints.http +++ b/endpoints.http @@ -1,28 +1,88 @@ -@baseUri=http://localhost:3000 -@username={{$randomInt}} -@email={{$randomInt}}@google.com -GET {{baseUri}} HTTP/1.1 +GET {{baseUrl}}/budget/:id/add HTTP/1.1 -POST {{baseUri}}/auth/register HTTP/1.1 -Content-Type: application/json +### +GET {{baseUrl}}/admin/users HTTP/1.1 -{"username":"{{username}}","password":"password","email":"{{email}}","type":"monitor"} ### +GET {{baseUrl}}/admin/user/:id HTTP/1.1 -POST {{baseUri}}/auth/login HTTP/1.1 +### +DELETE {{baseUrl}}/admin/user/:id HTTP/1.1 + +### +GET {{baseUrl}}/alarm/:id HTTP/1.1 + +### +PUT {{baseUrl}}/alarm/:id HTTP/1.1 + +### +GET {{baseUrl}}/alarms HTTP/1.1 + +### +GET {{baseUrl}}/alarm/@me HTTP/1.1 + +### +PUT {{baseUrl}}/alarm/@me HTTP/1.1 + +### +DELETE {{baseUrl}}/alarm/@me HTTP/1.1 + +### +# Delete account +DELETE {{baseUrl}}/auth/delete HTTP/1.1 Content-Type: application/json -{"username":"{{username}}","password":"password"} +{ + "username": "{{username}}", + "email": "{{email}}", + "password": "{{email}}" +} + + ### +GET {{baseUrl}}/budget/:id HTTP/1.1 -POST {{baseUri}}/auth/logout HTTP/1.1 +### +GET {{baseUrl}}/budget/@me HTTP/1.1 + +### +GET {{baseUrl}}/auth/devices HTTP/1.1 + +### +GET {{baseUrl}}/ HTTP/1.1 + +### +# Log in as a user +POST {{baseUrl}}/auth/login HTTP/1.1 Content-Type: application/json -{"username":"{{username}}","password":"password"} +{ + "username": "{{username}}", + "email": "{{email}}", + "password": "{{email}}" +} + + ### +# Log out from a device (TODO) +POST {{baseUrl}}/auth/logout HTTP/1.1 +Authorization: Bearer {{accessToken}} -DELETE {{baseUri}}/auth/delete +### +# Create a new user +POST {{baseUrl}}/auth/register HTTP/1.1 Content-Type: application/json -{"username":"{{username}}","password":"password"} +{ + "username": "{{username}}", + "email": "{{email}}", + "password": "{{email}}", + "type": "{{userType}}" +} + + +### +GET {{baseUrl}}/status HTTP/1.1 + +### -- cgit 1.5.1