Skip to content

founderhacker/textbelt_deployable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextBelt Open Source (Deployable Edition)

TextBelt Open Source is a REST API that sends outgoing SMS. It uses a free mechanism for sending texts, different from the more reliable paid version available at https://textbelt.com.

Send a text with a simple POST request:

$ curl -X POST http://my_textbelt_server/text \
   -d number=5551234567 \
   -d "message=I sent this message for free with Textbelt"

number and message parameters are required.

Local development / testing

first, clone this repo. then...

# 1. install dependencies
npm install # for reference, i used node 16.17.0

# 2. config your email inside lib/config.js (note the Gmail defaults and password instructions)

# 3. run the server 
redis-server # should default to port 6379
node server/app.js # (new terminal tab)

# 4. send yourself a text message
curl -X GET http://localhost:9090/text \
   -d number=<your-cell-phone> \
   -d "message=I sent this message for free with Textbelt"

you may prefer to change your Gmail credentials (step 2) to environment variables before pushing this code to a private repo on your own GitHub account.

git add .
git commit -m 'prepare textbelt for deploy'
git remote set-url origin https://github.com/yourusername/your_new_repo

Deploying to your own server

  1. create a free Render.com account. this is basically like Heroku.
  2. make a "Web Service" from your dashboard or click New > Web Service from navigation
  3. auth your GitHub and select the textbelt repository you created
  4. name your app, e.g. textbelt, then set Environment to Node, Build Command to npm install, and Start Command to node server/app.js
  5. select the free Instance Type
  6. if you refactored lib/config.js to use environment variables, plug those in by clicking Advanced > Add Environment Variable
  7. click Create Web Service

this will build and deploy your code. when it's done, click the URL generated by Render and you should see the "homepage" saying I'm online!.

finally, test your live server:

curl -X GET https://your-textbelt-server.onrender.com/text \
  -d number="your-cell-phone" \
  -d "message=A free text message with Textbelt on Render"

enjoy! and huge thanks to Ian Webster for creating TextBelt.

About

Free API for outgoing SMS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.9%
  • Procfile 0.1%