refactor: isolate SSE setup
This commit is contained in:
14
README.md
14
README.md
@@ -132,6 +132,20 @@ docker compose down --remove-orphans
|
||||
* Arranca en puerto **80** internamente.
|
||||
* Código fuente en `ui/src/`, configuración en `vite.config.js`.
|
||||
|
||||
### Notificaciones en tiempo real (SSE)
|
||||
|
||||
El backend expone un endpoint `/events` que utiliza **Server-Sent Events**. La
|
||||
base de datos PostgreSQL emite mensajes mediante triggers y el servidor los
|
||||
reenvía a los navegadores conectados.
|
||||
|
||||
```javascript
|
||||
const source = new EventSource('http://localhost:4000/events');
|
||||
source.onmessage = (e) => {
|
||||
const data = JSON.parse(e.data);
|
||||
console.log('Evento recibido', data);
|
||||
};
|
||||
```
|
||||
|
||||
#### Card Animation
|
||||
The data cards implemented in `ui/src/components/ui/NucleoDataCard.vue` now feature a subtle growing animation when hovered over. This animation is implemented purely with CSS using keyframes and transitions defined within the component's `<style scoped>` section, ensuring the styles are encapsulated and don't affect other elements.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user