Skip to content

Send sms or a beautiful quote to your friend by a simple POST request.

License

Notifications You must be signed in to change notification settings

Pradumnasaraf/Post-My-Message

post my message banner

Send sms or a beautiful quote to your friend by a simple POST request.

Format Publish Image to GitHub Container Registry Linter Releases

👨‍💻 Tech stack

🛠️ Using the Routes

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"
}

👨‍💻 Developing the API

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

Open in 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

🛡️ License

This project is licensed under the GPL-3.0 license - see the LICENSE file for details

🤝 Support

If you liked the project, please consider giving it a ⭐️