Giter Club home page Giter Club logo

textbelt_deployable's Introduction

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.

textbelt_deployable's People

Contributors

typpo avatar dependabot[bot] avatar ryanckulp avatar taylor-russ avatar daluu avatar timothywillard avatar djds23 avatar duckbrain avatar samyok avatar petehunt avatar vdrey avatar alexionescu avatar chandlerswift avatar bronzehedwick avatar aranaur avatar farazfazli avatar jconroy77 avatar lalongooo avatar markfinn avatar pgibler avatar ramyzhang avatar randomite avatar sigv avatar jahjahcity avatar kthibodeaux avatar zakaria-um6p avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.