use 3000 port

This commit is contained in:
Niccolo Borgioli 2024-08-23 14:27:17 +02:00
parent 2006be0434
commit a45f6a3772
7 changed files with 634 additions and 713 deletions

View File

@ -15,13 +15,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/notes/:id", "raw": "{{BASE}}/notes/:id",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ":id"],
],
"path": [
"notes",
":id"
],
"variable": [ "variable": [
{ {
"key": "id", "key": "id",
@ -40,13 +35,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/notes/:id", "raw": "{{BASE}}/notes/:id",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ":id"],
],
"path": [
"notes",
":id"
],
"variable": [ "variable": [
{ {
"key": "id", "key": "id",
@ -95,13 +85,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/notes/:id", "raw": "{{BASE}}/notes/:id",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ":id"],
],
"path": [
"notes",
":id"
],
"variable": [ "variable": [
{ {
"key": "id", "key": "id",
@ -170,13 +155,8 @@
}, },
"url": { "url": {
"raw": "{{BASE}}/notes/", "raw": "{{BASE}}/notes/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ""]
],
"path": [
"notes",
""
]
} }
}, },
"response": [ "response": [
@ -196,13 +176,8 @@
}, },
"url": { "url": {
"raw": "{{BASE}}/notes/", "raw": "{{BASE}}/notes/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ""]
],
"path": [
"notes",
""
]
} }
}, },
"status": "OK", "status": "OK",
@ -253,13 +228,8 @@
}, },
"url": { "url": {
"raw": "{{BASE}}/notes/", "raw": "{{BASE}}/notes/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ""]
],
"path": [
"notes",
""
]
} }
}, },
"status": "OK", "status": "OK",
@ -310,13 +280,8 @@
}, },
"url": { "url": {
"raw": "{{BASE}}/notes/", "raw": "{{BASE}}/notes/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ""]
],
"path": [
"notes",
""
]
} }
}, },
"status": "OK", "status": "OK",
@ -360,13 +325,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/notes/:id", "raw": "{{BASE}}/notes/:id",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ":id"],
],
"path": [
"notes",
":id"
],
"variable": [ "variable": [
{ {
"key": "id", "key": "id",
@ -384,13 +344,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/notes/:id", "raw": "{{BASE}}/notes/:id",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ":id"],
],
"path": [
"notes",
":id"
],
"variable": [ "variable": [
{ {
"key": "id", "key": "id",
@ -438,13 +393,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/notes/:id", "raw": "{{BASE}}/notes/:id",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["notes", ":id"],
],
"path": [
"notes",
":id"
],
"variable": [ "variable": [
{ {
"key": "id", "key": "id",
@ -495,13 +445,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/status/", "raw": "{{BASE}}/status/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["status", ""]
],
"path": [
"status",
""
]
} }
}, },
"response": [ "response": [
@ -512,13 +457,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/status/", "raw": "{{BASE}}/status/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["status", ""]
],
"path": [
"status",
""
]
} }
}, },
"status": "OK", "status": "OK",
@ -562,13 +502,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/live/", "raw": "{{BASE}}/live/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["live", ""]
],
"path": [
"live",
""
]
}, },
"description": "Return `200` for healthy service. `503` if service is unavailable." "description": "Return `200` for healthy service. `503` if service is unavailable."
}, },
@ -580,13 +515,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/live/", "raw": "{{BASE}}/live/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["live", ""]
],
"path": [
"live",
""
]
} }
}, },
"status": "OK", "status": "OK",
@ -620,13 +550,8 @@
"header": [], "header": [],
"url": { "url": {
"raw": "{{BASE}}/live/", "raw": "{{BASE}}/live/",
"host": [ "host": ["{{BASE}}"],
"{{BASE}}" "path": ["live", ""]
],
"path": [
"live",
""
]
} }
}, },
"status": "Service Unavailable", "status": "Service Unavailable",
@ -663,25 +588,21 @@
"listen": "prerequest", "listen": "prerequest",
"script": { "script": {
"type": "text/javascript", "type": "text/javascript",
"exec": [ "exec": [""]
""
]
} }
}, },
{ {
"listen": "test", "listen": "test",
"script": { "script": {
"type": "text/javascript", "type": "text/javascript",
"exec": [ "exec": [""]
""
]
} }
} }
], ],
"variable": [ "variable": [
{ {
"key": "BASE", "key": "BASE",
"value": "http://localhost:1234/api", "value": "http://localhost:3000/api",
"type": "default" "type": "default"
}, },
{ {

View File

@ -60,7 +60,7 @@ se usa para guardar y recuperar la nota. Después la nota es encriptada con la <
## Variables de entorno ## Variables de entorno
| Variable | Default | Descripción | | 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) | | `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/). <br> `512 MiB` es el máximo permitido. <br> El frontend mostrará ese número, incluyendo el ~35% de sobrecarga de codificación. | | `SIZE_LIMIT` | `1 KiB` | Tamaño máximo. Valores aceptados según la [unidad byte](https://docs.rs/byte-unit/). <br> `512 MiB` es el máximo permitido. <br> El frontend mostrará ese número, incluyendo el ~35% de sobrecarga de codificación. |
| `MAX_VIEWS` | `100` | Número máximo de vistas. | | `MAX_VIEWS` | `100` | Número máximo de vistas. |
@ -169,7 +169,7 @@ Ejecutando `pnpm run dev` en la carpeta raíz iniciará lo siguiente:
- client - client
- cli - 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) > Existe una colección de Postman con algunas peticiones de ejemplo [disponible en el repo](./Cryptgeon.postman_collection.json)

View File

@ -158,7 +158,7 @@ pnpm run dev
- 无热重载的 rust 后端 - 无热重载的 rust 后端
- 可热重载的客户端 - 可热重载的客户端
你可以通过 1234 端口进入该应用,即 [localhost:1234](http://localhost:1234). 你可以通过 3000 端口进入该应用,即 [localhost:3000](http://localhost:3000).
## 测试 ## 测试

View File

@ -14,7 +14,7 @@ services:
- redis - redis
restart: unless-stopped restart: unless-stopped
ports: ports:
- 1234:8000 - 3000:8000
healthcheck: healthcheck:
test: ['CMD', 'curl', '--fail', 'http://127.0.0.1:8000/api/live/'] test: ['CMD', 'curl', '--fail', 'http://127.0.0.1:8000/api/live/']

View File

@ -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' const target = req.url.startsWith('/api/') ? 'http://127.0.0.1:8000' : 'http://localhost:8001'
proxy.web(req, res, { target, proxyTimeout: 250, timeout: 250 }) proxy.web(req, res, { target, proxyTimeout: 250, timeout: 250 })
}) })
server.listen(1234) server.listen(3000)
console.log('Proxy on http://localhost:1234') console.log('Proxy on http://localhost:3000')

View File

@ -3,7 +3,7 @@ import { devices, type PlaywrightTestConfig } from '@playwright/test'
const config: PlaywrightTestConfig = { const config: PlaywrightTestConfig = {
use: { use: {
video: 'retain-on-failure', video: 'retain-on-failure',
baseURL: 'http://localhost:1234', baseURL: 'http://localhost:3000',
actionTimeout: 10_000, actionTimeout: 10_000,
}, },
@ -14,7 +14,7 @@ const config: PlaywrightTestConfig = {
webServer: { webServer: {
command: 'docker compose -f docker-compose.dev.yaml up', command: 'docker compose -f docker-compose.dev.yaml up',
port: 1234, port: 3000,
reuseExistingServer: true, reuseExistingServer: true,
}, },

View File

@ -91,7 +91,7 @@ export async function CLI(...args: string[]) {
return await exec('./packages/cli/dist/cli.cjs', args, { return await exec('./packages/cli/dist/cli.cjs', args, {
env: { env: {
...process.env, ...process.env,
CRYPTGEON_SERVER: 'http://localhost:1234', CRYPTGEON_SERVER: 'http://localhost:3000',
}, },
}) })
} }