This is a simple API built in Golang that utilizes the Pusher API to handle multiple responses and return a successful response. It is designed to work with POST requests.
-
Clone the repository:
git clone https://github.com/your/repository.git
-
Clone the repository:
go mod download
-
Configure the Pusher API credentials:
Open the config.go file. Replace
PUSHER_APP_ID
,PUSHER_KEY
,PUSHER_SECRET
, andPUSHER_CLUSTER
with your actual Pusher API credentials.
-
Start the server:
go run main.go
-
Make a POST request to the API:
Endpoint: /api Request body: Include any necessary data in the JSON format
-
Example using cURL:
curl -X POST -H "Content-Type: application/json" -d '{"key1":"value1","key2":"value2"}' http://localhost:8000/api
Replace http://localhost:8000 with the actual URL of your server.
-
The API will process the request and use the Pusher API to send multiple responses.
-
Upon successful completion, the API will return a JSON response with the following structure:
{
"status": "success",
"message": "Request processed successfully."
}
This API relies on the following dependencies:
Pusher
- Used to handle real-time communication and send multiple responses.
Contributions are welcome! If you find any issues or have suggestions, please open an issue or submit a pull request.
This project is just a personal project
Feel free to customize the README file based on your specific API implementation and requirements.