https://github.com/cristianprochnow/aping
🏓 API to play PING-PONG.
https://github.com/cristianprochnow/aping
php rest-api
Last synced: about 1 year ago
JSON representation
🏓 API to play PING-PONG.
- Host: GitHub
- URL: https://github.com/cristianprochnow/aping
- Owner: cristianprochnow
- License: mit
- Created: 2022-11-15T19:46:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-15T20:10:24.000Z (over 3 years ago)
- Last Synced: 2025-02-02T13:15:40.475Z (over 1 year ago)
- Topics: php, rest-api
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aping
**🏓 API to play PING-PONG.**
## About
A rest API made with PHP to play game with words using resource from URI. If you send `ping`, it returns `pong`, and vice versa.
> Response from API are all in JSON format. And, when wrong path is sent, so there is no response and HTTP Header returns with `404` code.
![response-example-not-found]
## Routes
Root path for all routes must have `index.php`. So, if you are using `localhost` and use `git clone` into root folder from `localhost`, so `root path` will be
```
→ http://localhost/aping/index.php
```
![response-example]
### GET
**Path**
> `/game/ping`
**Response**
```json
{
"message": "PONG"
}
```
**Path**
> `/game/pong`
**Response**
```json
{
"message": "PING"
}
```
## Getting Started
### Prerequisites
To run this project, you will need an Apache server with PHP recognition, to make requests.
So, to this, you can use `Docker` or tools like `XAMPP`, `WAMP` and others like these that offers ready environments for PHP and Apache integration.
### Run
To run this, just make a `git clone` from it project and then use tools like `Insomnia` or `Postman` to make requests to path described in **Routes** section.
## Built With
- [x] PHP
[response-example]: ./.github/example-response.jpg
[response-example-not-found]: ./.github/example-response-not-found.jpg