After deploying the API the request will be on {API_BASE_URL}/{route}. This project is deployed with the base URL as https://post-my-message.vercel.app.
Send a custom message to a number - /sendsms
POST method.
It sends a custom message to the number provided. The request body should have a "phone"
and "message"
property that contains the receiver's number and a message. The POST body should be in JSON format.
{
"message": "Hey, this message is from Twilio",
"phone": "+111111111111"
}
Send a random quote to a number - /sendquote
POST method.
It sends a random quote to the number provided. The request body should have a "phone"
property that contains the receiver's number. The POST body should be in JSON format.
{
"phone": "+111111111111"
}
This section includes how to test and develop API at your end. You can either run it in the cloud using Gitpod or run it inside a container using docker or choose to set up the complete environment locally.
GitPod
Docker Compose
Prerequisites - Docker and Compose installed in your local system.
NOTE: First add the the environment variables to the
.env.example
file.
You can run below command and you can access the API at localhost:9001
docker compose up
Local setup
Prerequisites- Node.js installed and a Mongo server on your localhost.
NOTE: First add the the environment variables to the
.env.example
file.
Step 1: Copy .env.example
to .env
.
npm run env
Step 2: Run the app in development mode.
npm run dev
You can access the API at localhost:9001
This project is licensed under the GPL-3.0 license - see the LICENSE file for details
If you liked the project, please consider giving it a ⭐️