Skip to content

Add new lab API (POST & GET)#27

Open
GilbertPlazas wants to merge 6 commits intoAlonza0314:mainfrom
GilbertPlazas:feature/new-api
Open

Add new lab API (POST & GET)#27
GilbertPlazas wants to merge 6 commits intoAlonza0314:mainfrom
GilbertPlazas:feature/new-api

Conversation

@GilbertPlazas
Copy link

This pull request implements the Lab 6 task for nf-example.

Changes:

Add a new file for GET & POST and modify router.go and server.go
Implemented GET /data endpoint that returns a student
Implemented POST /student/register endpoint that receives name, semester and career in JSON and returns the created student.
Test:

make
./bin/nf -c config/nfcfg.yaml
curl http://127.0.0.163:8000/student/data
curl -X POST http://127.0.0.163:8000/student/register -H "Content-Type: application/json" -d '{"name":"name","semester": #, "career":"career"}'

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