diff --git a/Cryptgeon.postman_collection.json b/Cryptgeon.postman_collection.json
index 08d3c44..655151f 100644
--- a/Cryptgeon.postman_collection.json
+++ b/Cryptgeon.postman_collection.json
@@ -1,693 +1,614 @@
{
- "info": {
- "_postman_id": "3aaeac19-4eac-4911-b3c8-912b17a48634",
- "name": "Cryptgeon",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
- },
- "item": [
- {
- "name": "Notes",
- "item": [
- {
- "name": "Preview",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/notes/:id",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ":id"
- ],
- "variable": [
- {
- "key": "id",
- "value": "{{NOTE_ID}}",
- "description": "Id of the Note"
- }
- ]
- },
- "description": "This endpoint is to query wether a note exists, without actually opening it. No view limits are used here, as contents of the note are not available, only the `meta` field is returned, which is public."
- },
- "response": [
- {
- "name": "200",
- "originalRequest": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/notes/:id",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ":id"
- ],
- "variable": [
- {
- "key": "id",
- "value": "{{NOTE_ID}}",
- "description": "Id of the Note"
- }
- ]
- }
- },
- "status": "OK",
- "code": 200,
- "_postman_previewlanguage": "json",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "content-type",
- "value": "application/json"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:24:29 GMT"
- }
- ],
- "cookie": [],
- "body": "{}"
- },
- {
- "name": "404",
- "originalRequest": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/notes/:id",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ":id"
- ],
- "variable": [
- {
- "key": "id",
- "value": "{{NOTE_ID}}",
- "description": "Id of the Note"
- }
- ]
- }
- },
- "status": "Not Found",
- "code": 404,
- "_postman_previewlanguage": "plain",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:25:26 GMT"
- }
- ],
- "cookie": [],
- "body": ""
- }
- ]
- },
- {
- "name": "Create",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "const jsonData = pm.response.json();",
- "pm.collectionVariables.set('NOTE_ID', jsonData.id)",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"contents\": \"Some encrypted content\",\n \"views\": 1,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{BASE}}/notes/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ""
- ]
- }
- },
- "response": [
- {
- "name": "Simple",
- "originalRequest": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"contents\": \"Some encrypted content\",\n \"views\": 1,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{BASE}}/notes/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ""
- ]
- }
- },
- "status": "OK",
- "code": 200,
- "_postman_previewlanguage": "json",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "content-type",
- "value": "application/json"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:31:54 GMT"
- }
- ],
- "cookie": [],
- "body": "{\n \"id\": \"1QeEWDQbQY9dOo8cDDQjykaEjouqugTR6A78sjgn4VMv\"\n}"
- },
- {
- "name": "5 Minutes",
- "originalRequest": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"contents\": \"Some encrypted content\",\n \"expiration\": 5,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{BASE}}/notes/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ""
- ]
- }
- },
- "status": "OK",
- "code": 200,
- "_postman_previewlanguage": "json",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "content-type",
- "value": "application/json"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:31:54 GMT"
- }
- ],
- "cookie": [],
- "body": "{\n \"id\": \"1QeEWDQbQY9dOo8cDDQjykaEjouqugTR6A78sjgn4VMv\"\n}"
- },
- {
- "name": "3 Views",
- "originalRequest": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"contents\": \"Some encrypted content\",\n \"views\": 3,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{BASE}}/notes/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ""
- ]
- }
- },
- "status": "OK",
- "code": 200,
- "_postman_previewlanguage": "json",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "content-type",
- "value": "application/json"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:31:54 GMT"
- }
- ],
- "cookie": [],
- "body": "{\n \"id\": \"1QeEWDQbQY9dOo8cDDQjykaEjouqugTR6A78sjgn4VMv\"\n}"
- }
- ]
- },
- {
- "name": "Read",
- "request": {
- "method": "DELETE",
- "header": [],
- "url": {
- "raw": "{{BASE}}/notes/:id",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ":id"
- ],
- "variable": [
- {
- "key": "id",
- "value": "{{NOTE_ID}}"
- }
- ]
- },
- "description": "This endpoint gets the actual contents of a note. It's a `DELETE` endpoint, es it decreases the `view` counter, and deletes the note if `0` is reached."
- },
- "response": [
- {
- "name": "200",
- "originalRequest": {
- "method": "DELETE",
- "header": [],
- "url": {
- "raw": "{{BASE}}/notes/:id",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ":id"
- ],
- "variable": [
- {
- "key": "id",
- "value": "{{NOTE_ID}}"
- }
- ]
- }
- },
- "status": "OK",
- "code": 200,
- "_postman_previewlanguage": "json",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "content-type",
- "value": "application/json"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:59:07 GMT"
- }
- ],
- "cookie": [],
- "body": "{\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\",\n \"contents\": \"Some encrypted content\"\n}"
- },
- {
- "name": "404",
- "originalRequest": {
- "method": "DELETE",
- "header": [],
- "url": {
- "raw": "{{BASE}}/notes/:id",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "notes",
- ":id"
- ],
- "variable": [
- {
- "key": "id",
- "value": "{{NOTE_ID}}"
- }
- ]
- }
- },
- "status": "Not Found",
- "code": 404,
- "_postman_previewlanguage": "plain",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:59:15 GMT"
- }
- ],
- "cookie": [],
- "body": ""
- }
- ]
- }
- ]
- },
- {
- "name": "Status",
- "item": [
- {
- "name": "Get server status",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/status/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "status",
- ""
- ]
- }
- },
- "response": [
- {
- "name": "200",
- "originalRequest": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/status/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "status",
- ""
- ]
- }
- },
- "status": "OK",
- "code": 200,
- "_postman_previewlanguage": "json",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "connection",
- "value": "close"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "content-type",
- "value": "application/json"
- },
- {
- "key": "date",
- "value": "Tue, 23 May 2023 05:56:45 GMT"
- }
- ],
- "cookie": [],
- "body": "{\n \"version\": \"2.3.0-beta.4\",\n \"max_size\": 10485760,\n \"max_views\": 100,\n \"max_expiration\": 360,\n \"allow_advanced\": true,\n \"theme_image\": \"\",\n \"theme_text\": \"\",\n \"theme_page_title\": \"\",\n \"theme_favicon\": \"\"\n}"
- }
- ]
- },
- {
- "name": "Health Check",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/live/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "live",
- ""
- ]
- },
- "description": "Return `200` for healthy service. `503` if service is unavailable."
- },
- "response": [
- {
- "name": "Healthy",
- "originalRequest": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/live/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "live",
- ""
- ]
- }
- },
- "status": "OK",
- "code": 200,
- "_postman_previewlanguage": "plain",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "date",
- "value": "Thu, 22 Jun 2023 20:17:58 GMT"
- }
- ],
- "cookie": [],
- "body": null
- },
- {
- "name": "Service Unavilable",
- "originalRequest": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{BASE}}/live/",
- "host": [
- "{{BASE}}"
- ],
- "path": [
- "live",
- ""
- ]
- }
- },
- "status": "Service Unavailable",
- "code": 503,
- "_postman_previewlanguage": "plain",
- "header": [
- {
- "key": "transfer-encoding",
- "value": "chunked"
- },
- {
- "key": "content-encoding",
- "value": "gzip"
- },
- {
- "key": "vary",
- "value": "accept-encoding"
- },
- {
- "key": "date",
- "value": "Thu, 22 Jun 2023 20:18:55 GMT"
- }
- ],
- "cookie": [],
- "body": null
- }
- ]
- }
- ]
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "type": "text/javascript",
- "exec": [
- ""
- ]
- }
- },
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- ""
- ]
- }
- }
- ],
- "variable": [
- {
- "key": "BASE",
- "value": "http://localhost:1234/api",
- "type": "default"
- },
- {
- "key": "NOTE_ID",
- "value": "",
- "type": "default"
- }
- ]
-}
\ No newline at end of file
+ "info": {
+ "_postman_id": "3aaeac19-4eac-4911-b3c8-912b17a48634",
+ "name": "Cryptgeon",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+ },
+ "item": [
+ {
+ "name": "Notes",
+ "item": [
+ {
+ "name": "Preview",
+ "request": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/notes/:id",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ":id"],
+ "variable": [
+ {
+ "key": "id",
+ "value": "{{NOTE_ID}}",
+ "description": "Id of the Note"
+ }
+ ]
+ },
+ "description": "This endpoint is to query wether a note exists, without actually opening it. No view limits are used here, as contents of the note are not available, only the `meta` field is returned, which is public."
+ },
+ "response": [
+ {
+ "name": "200",
+ "originalRequest": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/notes/:id",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ":id"],
+ "variable": [
+ {
+ "key": "id",
+ "value": "{{NOTE_ID}}",
+ "description": "Id of the Note"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "content-type",
+ "value": "application/json"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:24:29 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": "{}"
+ },
+ {
+ "name": "404",
+ "originalRequest": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/notes/:id",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ":id"],
+ "variable": [
+ {
+ "key": "id",
+ "value": "{{NOTE_ID}}",
+ "description": "Id of the Note"
+ }
+ ]
+ }
+ },
+ "status": "Not Found",
+ "code": 404,
+ "_postman_previewlanguage": "plain",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:25:26 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ }
+ ]
+ },
+ {
+ "name": "Create",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "const jsonData = pm.response.json();",
+ "pm.collectionVariables.set('NOTE_ID', jsonData.id)",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"contents\": \"Some encrypted content\",\n \"views\": 1,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{BASE}}/notes/",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ""]
+ }
+ },
+ "response": [
+ {
+ "name": "Simple",
+ "originalRequest": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"contents\": \"Some encrypted content\",\n \"views\": 1,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{BASE}}/notes/",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ""]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "content-type",
+ "value": "application/json"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:31:54 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"id\": \"1QeEWDQbQY9dOo8cDDQjykaEjouqugTR6A78sjgn4VMv\"\n}"
+ },
+ {
+ "name": "5 Minutes",
+ "originalRequest": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"contents\": \"Some encrypted content\",\n \"expiration\": 5,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{BASE}}/notes/",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ""]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "content-type",
+ "value": "application/json"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:31:54 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"id\": \"1QeEWDQbQY9dOo8cDDQjykaEjouqugTR6A78sjgn4VMv\"\n}"
+ },
+ {
+ "name": "3 Views",
+ "originalRequest": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"contents\": \"Some encrypted content\",\n \"views\": 3,\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{BASE}}/notes/",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ""]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "content-type",
+ "value": "application/json"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:31:54 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"id\": \"1QeEWDQbQY9dOo8cDDQjykaEjouqugTR6A78sjgn4VMv\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Read",
+ "request": {
+ "method": "DELETE",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/notes/:id",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ":id"],
+ "variable": [
+ {
+ "key": "id",
+ "value": "{{NOTE_ID}}"
+ }
+ ]
+ },
+ "description": "This endpoint gets the actual contents of a note. It's a `DELETE` endpoint, es it decreases the `view` counter, and deletes the note if `0` is reached."
+ },
+ "response": [
+ {
+ "name": "200",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/notes/:id",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ":id"],
+ "variable": [
+ {
+ "key": "id",
+ "value": "{{NOTE_ID}}"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "content-type",
+ "value": "application/json"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:59:07 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"meta\": \"{\\\"type\\\":\\\"text\\\"}\",\n \"contents\": \"Some encrypted content\"\n}"
+ },
+ {
+ "name": "404",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/notes/:id",
+ "host": ["{{BASE}}"],
+ "path": ["notes", ":id"],
+ "variable": [
+ {
+ "key": "id",
+ "value": "{{NOTE_ID}}"
+ }
+ ]
+ }
+ },
+ "status": "Not Found",
+ "code": 404,
+ "_postman_previewlanguage": "plain",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:59:15 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Status",
+ "item": [
+ {
+ "name": "Get server status",
+ "request": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/status/",
+ "host": ["{{BASE}}"],
+ "path": ["status", ""]
+ }
+ },
+ "response": [
+ {
+ "name": "200",
+ "originalRequest": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/status/",
+ "host": ["{{BASE}}"],
+ "path": ["status", ""]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "connection",
+ "value": "close"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "content-type",
+ "value": "application/json"
+ },
+ {
+ "key": "date",
+ "value": "Tue, 23 May 2023 05:56:45 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"version\": \"2.3.0-beta.4\",\n \"max_size\": 10485760,\n \"max_views\": 100,\n \"max_expiration\": 360,\n \"allow_advanced\": true,\n \"theme_image\": \"\",\n \"theme_text\": \"\",\n \"theme_page_title\": \"\",\n \"theme_favicon\": \"\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Health Check",
+ "request": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/live/",
+ "host": ["{{BASE}}"],
+ "path": ["live", ""]
+ },
+ "description": "Return `200` for healthy service. `503` if service is unavailable."
+ },
+ "response": [
+ {
+ "name": "Healthy",
+ "originalRequest": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/live/",
+ "host": ["{{BASE}}"],
+ "path": ["live", ""]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "plain",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "date",
+ "value": "Thu, 22 Jun 2023 20:17:58 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": null
+ },
+ {
+ "name": "Service Unavilable",
+ "originalRequest": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{BASE}}/live/",
+ "host": ["{{BASE}}"],
+ "path": ["live", ""]
+ }
+ },
+ "status": "Service Unavailable",
+ "code": 503,
+ "_postman_previewlanguage": "plain",
+ "header": [
+ {
+ "key": "transfer-encoding",
+ "value": "chunked"
+ },
+ {
+ "key": "content-encoding",
+ "value": "gzip"
+ },
+ {
+ "key": "vary",
+ "value": "accept-encoding"
+ },
+ {
+ "key": "date",
+ "value": "Thu, 22 Jun 2023 20:18:55 GMT"
+ }
+ ],
+ "cookie": [],
+ "body": null
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "event": [
+ {
+ "listen": "prerequest",
+ "script": {
+ "type": "text/javascript",
+ "exec": [""]
+ }
+ },
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [""]
+ }
+ }
+ ],
+ "variable": [
+ {
+ "key": "BASE",
+ "value": "http://localhost:3000/api",
+ "type": "default"
+ },
+ {
+ "key": "NOTE_ID",
+ "value": "",
+ "type": "default"
+ }
+ ]
+}
diff --git a/README_ES.md b/README_ES.md
index 272494e..5febea8 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -59,19 +59,19 @@ se usa para guardar y recuperar la nota. Después la nota es encriptada con la <
## Variables de entorno
-| Variable | Default | Descripción |
-| ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `REDIS` | `redis://redis/` | Redis URL a la que conectarse. [Según el formato](https://docs.rs/redis/latest/redis/#connection-parameters) |
+| Variable | Default | Descripción |
+| ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `REDIS` | `redis://redis/` | Redis URL a la que conectarse. [Según el formato](https://docs.rs/redis/latest/redis/#connection-parameters) |
| `SIZE_LIMIT` | `1 KiB` | Tamaño máximo. Valores aceptados según la [unidad byte](https://docs.rs/byte-unit/).
`512 MiB` es el máximo permitido.
El frontend mostrará ese número, incluyendo el ~35% de sobrecarga de codificación. |
-| `MAX_VIEWS` | `100` | Número máximo de vistas. |
-| `MAX_EXPIRATION` | `360` | Tiempo máximo de expiración en minutos. |
-| `ALLOW_ADVANCED` | `true` | Permitir configuración personalizada. Si se establece en `false` todas las notas serán de una sola vista. |
-| `ID_LENGTH` | `32` | Establece el tamaño en bytes de la `id` de la nota. Por defecto es de `32` bytes. Esto es util para reducir el tamaño del link. _Esta configuración no afecta el nivel de encriptación_. |
-| `VERBOSITY` | `warn` | Nivel de verbosidad del backend. [Posibles valores](https://docs.rs/env_logger/latest/env_logger/#enabling-logging): `error`, `warn`, `info`, `debug`, `trace` |
-| `THEME_IMAGE` | `""` | Imagen personalizada para reemplazar el logo. Debe ser accesible públicamente. |
-| `THEME_TEXT` | `""` | Texto personalizado para reemplazar la descripción bajo el logo. |
-| `THEME_PAGE_TITLE` | `""` | Texto personalizado para el título |
-| `THEME_FAVICON` | `""` | Url personalizada para el favicon. Debe ser accesible públicamente. |
+| `MAX_VIEWS` | `100` | Número máximo de vistas. |
+| `MAX_EXPIRATION` | `360` | Tiempo máximo de expiración en minutos. |
+| `ALLOW_ADVANCED` | `true` | Permitir configuración personalizada. Si se establece en `false` todas las notas serán de una sola vista. |
+| `ID_LENGTH` | `32` | Establece el tamaño en bytes de la `id` de la nota. Por defecto es de `32` bytes. Esto es util para reducir el tamaño del link. _Esta configuración no afecta el nivel de encriptación_. |
+| `VERBOSITY` | `warn` | Nivel de verbosidad del backend. [Posibles valores](https://docs.rs/env_logger/latest/env_logger/#enabling-logging): `error`, `warn`, `info`, `debug`, `trace` |
+| `THEME_IMAGE` | `""` | Imagen personalizada para reemplazar el logo. Debe ser accesible públicamente. |
+| `THEME_TEXT` | `""` | Texto personalizado para reemplazar la descripción bajo el logo. |
+| `THEME_PAGE_TITLE` | `""` | Texto personalizado para el título |
+| `THEME_FAVICON` | `""` | Url personalizada para el favicon. Debe ser accesible públicamente. |
## Despliegue
@@ -169,7 +169,7 @@ Ejecutando `pnpm run dev` en la carpeta raíz iniciará lo siguiente:
- client
- cli
-Puedes ver la app en [localhost:1234](http://localhost:1234).
+Puedes ver la app en [localhost:3000](http://localhost:3000).
> Existe una colección de Postman con algunas peticiones de ejemplo [disponible en el repo](./Cryptgeon.postman_collection.json)
diff --git a/README_zh-CN.md b/README_zh-CN.md
index e60182a..b8e88ab 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -14,7 +14,7 @@
-[EN](README.md) | 简体中文 | [ES](README_ES.md)
+[EN](README.md) | 简体中文 | [ES](README_ES.md)
## 关于本项目
@@ -158,7 +158,7 @@ pnpm run dev
- 无热重载的 rust 后端
- 可热重载的客户端
-你可以通过 1234 端口进入该应用,即 [localhost:1234](http://localhost:1234).
+你可以通过 3000 端口进入该应用,即 [localhost:3000](http://localhost:3000).
## 测试
diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml
index 679ffd9..e0ab06d 100644
--- a/docker-compose.dev.yaml
+++ b/docker-compose.dev.yaml
@@ -14,7 +14,7 @@ services:
- redis
restart: unless-stopped
ports:
- - 1234:8000
+ - 3000:8000
healthcheck:
test: ['CMD', 'curl', '--fail', 'http://127.0.0.1:8000/api/live/']
diff --git a/packages/proxy/proxy.js b/packages/proxy/proxy.js
index 7e5292f..f434436 100644
--- a/packages/proxy/proxy.js
+++ b/packages/proxy/proxy.js
@@ -12,5 +12,5 @@ const server = http.createServer(function (req, res) {
const target = req.url.startsWith('/api/') ? 'http://127.0.0.1:8000' : 'http://localhost:8001'
proxy.web(req, res, { target, proxyTimeout: 250, timeout: 250 })
})
-server.listen(1234)
-console.log('Proxy on http://localhost:1234')
+server.listen(3000)
+console.log('Proxy on http://localhost:3000')
diff --git a/playwright.config.ts b/playwright.config.ts
index 4a71394..da301aa 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -3,7 +3,7 @@ import { devices, type PlaywrightTestConfig } from '@playwright/test'
const config: PlaywrightTestConfig = {
use: {
video: 'retain-on-failure',
- baseURL: 'http://localhost:1234',
+ baseURL: 'http://localhost:3000',
actionTimeout: 10_000,
},
@@ -14,7 +14,7 @@ const config: PlaywrightTestConfig = {
webServer: {
command: 'docker compose -f docker-compose.dev.yaml up',
- port: 1234,
+ port: 3000,
reuseExistingServer: true,
},
diff --git a/test/utils.ts b/test/utils.ts
index bc04228..4292510 100644
--- a/test/utils.ts
+++ b/test/utils.ts
@@ -91,7 +91,7 @@ export async function CLI(...args: string[]) {
return await exec('./packages/cli/dist/cli.cjs', args, {
env: {
...process.env,
- CRYPTGEON_SERVER: 'http://localhost:1234',
+ CRYPTGEON_SERVER: 'http://localhost:3000',
},
})
}