Skip to content

Comments

feat(api): add MyAPI service with GET /hello and POST /echo endpoints#22

Open
Laurajimenez25 wants to merge 3 commits intoAlonza0314:mainfrom
Laurajimenez25:feature/new-api-service
Open

feat(api): add MyAPI service with GET /hello and POST /echo endpoints#22
Laurajimenez25 wants to merge 3 commits intoAlonza0314:mainfrom
Laurajimenez25:feature/new-api-service

Conversation

@Laurajimenez25
Copy link

@Laurajimenez25 Laurajimenez25 commented Nov 12, 2025

This Pull Request implements a new API service as part of the Free5GC Lab 6 exercise.

Changes:

  • Added new API service /myapi with two endpoints:
    • GET /myapi/hello → returns greeting JSON.
    • POST /myapi/echo → echoes back posted JSON data.
  • Updated router.go to include the new service.
  • Added sample configuration file nfcfg.yaml.
  • Updated go.mod dependencies.

Testing:

The API was verified locally using:

  • curl http://127.0.0.1:29531/myapi/hello
  • curl -X POST http://127.0.0.1:29531/myapi/echo -H "Content-Type: application/json" -d "{\"name\":\"Laura\"}"

✅ All routes responded correctly.

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