Learning to build a REST server using Pascal
- Pascal 96.6%
- Makefile 3.4%
| .gitignore | feat: Dict REST server | |
| dict_rest_server.pas | refactor: Capitalize rest handler | |
| hello_world_rest_server.pas | refactor: Capitalize argument names | |
| LICENSE | docs: license | |
| Makefile | feat: Dict REST server | |
| README.org | docs(README): promote dict section | |
PascalRESTLearn
PascalRESTLearn curates Pascal code examples for building REST servers, designed to support learning.
Status
Work in progress
Prerequisites
- make (tested with GNU Make)
- fpc (Free Pascal Compiler)
Build
make
Run
./hello_world_rest_server
Usage
With a running server:
curl http://localhost:8080/api/message
Dict REST Server
Run
./dict_rest_server
Usage
Add item
curl -H 'Content-Type: application/json' \
-d '{"headword":"cat", "part_of_speech":"noun"}' \
localhost:8080/api/dict
curl -H 'Content-Type: application/json' \
-d '{"headword":"go", "part_of_speech":"verb"}' \
localhost:8080/api/dict
Get items
curl localhost:8080/api/dict