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

View File

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

View File

@ -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/']

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'
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')

View File

@ -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,
},

View File

@ -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',
},
})
}