Skip to content

Comments

feat(api): add MyAPI service with GET and POST endpoints#29

Open
lmaralegria wants to merge 1 commit intoandy89923:mainfrom
lmaralegria:feature/new-api-service
Open

feat(api): add MyAPI service with GET and POST endpoints#29
lmaralegria wants to merge 1 commit intoandy89923:mainfrom
lmaralegria:feature/new-api-service

Conversation

@lmaralegria
Copy link

Este PR agrega un nuevo servicio HTTP llamado MyAPI al NF de ejemplo.

Se crea el archivointernal/sbi/api_myapi.gocon dos endpoints:

GET /myapi/: retorna un JSON con el estado del servicio (service, status).

POST /myapi/echo: recibe un message en el cuerpo (JSON) y lo devuelve en la respuesta.

Se actualiza internal/sbi/router.go para registrar el nuevo grupo de rutas /myapi.

Probado ejecutando:

curl http://127.0.0.163:8000/myapi/

curl -X POST http://127.0.0.163:8000/myapi/echo -H "Content-Type: application/json" -d '{"message":"Hola desde MyAPI"}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant