Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage setup #1

Merged
merged 2 commits into from
Apr 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SENDGRID_USER=your_sendgrid_username
SENDGRID_PASSWORD=your_sendgrid_password
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ build/Release
# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
node_modules

.env*
!.env.example
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,15 @@

This is a demo application that allows the user to search for GIFs, built with Node.js, that uses both Giphy and the SendGrid API. You can use the website to search for GIFs, or you can email <gimmegif@bymail.in> with a query in the subject, to get an email response back with the GIF and also have that appear in the application using the SendGrid Inbound Parse API.

###Getting started
## Usage

```
cp .env.example .env
```

Edit the contents of `.env`.

```
npm install
node server.js
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"author": "Heitor <heitor@sendgrid.com>",
"license": "MIT",
"dependencies": {
"dotenv": "0.2.7",
"express": ">= 2.5.x",
"socket.io": ">= 0.9.x",
"sendgrid": ">= 0.2.x",
Expand Down
10 changes: 6 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ var express = require('express')
, io = require('socket.io').listen(server)
, mimelib = require("mimelib")
, request = require('request')
, sendgrid = require('sendgrid') (
(process.env.SENDGRID_USER || 'YOUR_SENDGRID_USERNAME'),
(process.env.SENDGRID_PASS || 'YOUR_SENDGRID_PASSWORD')
);
, dotenv = require('dotenv');

dotenv.load();
var SENDGRID_USER = process.env.SENDGRID_USER;
var SENDGRID_PASSWORD = process.env.SENDGRID_PASSWORD;
var sendgrid = require('sendgrid')(SENDGRID_USER, SENDGRID_PASSWORD);

var GiphyAPIKey = "dc6zaTOxFJmzC";
var applicationReplyUrl = "http://yourappurl.jit.su/reply";
Expand Down