add index page
This commit is contained in:
		
							
								
								
									
										7
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								app.js
									
									
									
									
									
								
							@@ -2,6 +2,7 @@ var express = require('express')
 | 
				
			|||||||
  , app = express.createServer()
 | 
					  , app = express.createServer()
 | 
				
			||||||
  , nodemailer = require('nodemailer')
 | 
					  , nodemailer = require('nodemailer')
 | 
				
			||||||
  , _ = require('underscore')
 | 
					  , _ = require('underscore')
 | 
				
			||||||
 | 
					  , fs = require('fs')
 | 
				
			||||||
  /*
 | 
					  /*
 | 
				
			||||||
  , amazonses = require('amazon-ses')
 | 
					  , amazonses = require('amazon-ses')
 | 
				
			||||||
  */
 | 
					  */
 | 
				
			||||||
@@ -37,7 +38,9 @@ app.use(express.bodyParser());
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Homepage */
 | 
					/* Homepage */
 | 
				
			||||||
app.get('/', function(req, res) {
 | 
					app.get('/', function(req, res) {
 | 
				
			||||||
  res.send("it's running");
 | 
					  fs.readFile(__dirname + '/views/index.html', 'utf8', function(err, text){
 | 
				
			||||||
 | 
					    res.send(text);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app.post('/text', function(req, res) {
 | 
					app.post('/text', function(req, res) {
 | 
				
			||||||
@@ -205,7 +208,7 @@ function sendText(phone, message, cb) {
 | 
				
			|||||||
  */
 | 
					  */
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var port = process.env.PORT || 8080;
 | 
					var port = process.env.PORT || 9090;
 | 
				
			||||||
app.listen(port, function() {
 | 
					app.listen(port, function() {
 | 
				
			||||||
  console.log('Listening on', port);
 | 
					  console.log('Listening on', port);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										68
									
								
								views/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								views/index.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,68 @@
 | 
				
			|||||||
 | 
					<!doctype html>
 | 
				
			||||||
 | 
					<html>
 | 
				
			||||||
 | 
					  <head>
 | 
				
			||||||
 | 
					    <meta charset="utf-8">
 | 
				
			||||||
 | 
					    <meta http-equiv="X-UA-Compatible" content="chrome=1">
 | 
				
			||||||
 | 
					    <title>TextBelt by typpo</title>
 | 
				
			||||||
 | 
					    <link rel="stylesheet" href="http://typpo.github.com/textbelt/stylesheets/styles.css">
 | 
				
			||||||
 | 
					    <link rel="stylesheet" href="http://typpo.github.com/textbelt/stylesheets/pygment_trac.css">
 | 
				
			||||||
 | 
					    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
 | 
				
			||||||
 | 
					    <script src="http://typpo.github.com/textbelt/javascripts/respond.js"></script>
 | 
				
			||||||
 | 
					    <!--[if lt IE 9]>
 | 
				
			||||||
 | 
					      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
 | 
				
			||||||
 | 
					    <![endif]-->
 | 
				
			||||||
 | 
					    <!--[if lt IE 8]>
 | 
				
			||||||
 | 
					    <link rel="stylesheet" href="stylesheets/ie.css">
 | 
				
			||||||
 | 
					    <![endif]-->
 | 
				
			||||||
 | 
					    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  </head>
 | 
				
			||||||
 | 
					  <body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <div class="wrapper">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <section>
 | 
				
			||||||
 | 
					        <div id="title">
 | 
				
			||||||
 | 
					          <h1>TextBelt</h1>
 | 
				
			||||||
 | 
					          <p>Free texting API</p>
 | 
				
			||||||
 | 
					          <hr>
 | 
				
			||||||
 | 
					          <!--<span class="credits left">Project maintained by <a href="https://github.com/typpo">typpo</a></span>-->
 | 
				
			||||||
 | 
					          <span class="credits right">Generated by GitHub Pages — Theme by <a href="http://twitter.com/#!/michigangraham">mattgraham</a></span>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <h3>TextBelt</h3>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<p>TextBelt is a texting API that uses carrier-specific gateways to deliver your text messages for free.  This is nice for a low-cost texting app or testing without running down your Twilio balance.</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<p>Usage is dead simple:</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<pre><code>$ curl <a href="http://textbelt.com/text">http://textbelt.com/text</a> \
 | 
				
			||||||
 | 
					   -d number=5551234567 \
 | 
				
			||||||
 | 
					   -d "message=I sent this message for free with textbelt.com"
 | 
				
			||||||
 | 
					</code></pre>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<h3>Success and Failure</h3>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<p>Sample success:</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<pre><code>{"success":true}
 | 
				
			||||||
 | 
					</code></pre>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<p>Sample failure:</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<pre><code>{"success":false,"message":"Exceeded quota for this phone number."}
 | 
				
			||||||
 | 
					</code></pre>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<h3>Notes and Limitations</h3>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<ul>
 | 
				
			||||||
 | 
					<li><p>IP addresses are limited to 75 texts per day.  Phone numbers are limited to 3 texts every 3 minutes.  If you need increased limits, please contact admin@textbelt.com.</p></li>
 | 
				
			||||||
 | 
					<li><p>Some carriers may deliver text messages from "txt@textbelt.com"</p></li>
 | 
				
			||||||
 | 
					<li><p>We support the following U.S. providers: Alltel, Ameritech, AT&T Wireless, Boost, CellularOne, Cingular, Edge Wireless, Sprint PCS, Telus Mobility, T-Mobile, Metro PCS, Nextel, O2, Orange, Qwest, Rogers Wireless, US Cellular, Verizon, Virgin Mobile.</p></li>
 | 
				
			||||||
 | 
					</ul>
 | 
				
			||||||
 | 
					      </section>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
 | 
				
			||||||
 | 
					  </body>
 | 
				
			||||||
 | 
					</html>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user