This is a simple study project that demonstrates a basic REST API created in Lazarus using the Horse framework. The API responds to a GET request at the /ping endpoint with a Pong message.
- Lazarus (with Delphi Mode)
- Horse framework
- Clone the repository or download the source code.
- Make sure you have the Horse framework installed in your Lazarus environment. You can install it via Horse GitHub.
- Open the
PingAPI.lprproject in Lazarus.
- Compile the project.
- The server will start listening on port
9000.
- GET /ping: Responds with
Pong.
To test the API, run the program and use any HTTP client to send a GET request to http://localhost:9000/ping. You should receive the following response:
Pong