Permalink
Browse files

added get for api verify

  • Loading branch information...
1 parent 39a72ea commit 27241d0920c51cba60b3da81af3ff8284d6cf44c @JustinBeckwith committed Sep 19, 2012
Showing with 47 additions and 25 deletions.
  1. +16 −0 cities.json
  2. +3 −2 package.json
  3. +19 −0 routes/home.js
  4. +0 −8 routes/index.js
  5. +0 −8 routes/user.js
  6. +8 −6 server.js
  7. +1 −1 web.config
View
@@ -0,0 +1,16 @@
+{
+ "name": "NodeSite",
+ "version": "0.0.1",
+ "author": "",
+ "description": "",
+ "contributors": [],
+ "main": "./server.js",
+ "keywords": [],
+ "dependencies": {},
+ "noAnalyze": true,
+ "engines": {
+ "node": ">=0.6"
+ },
+ "devDependencies": {},
+ "optionalDependencies": {}
+}
View
@@ -7,6 +7,7 @@
},
"dependencies": {
"express": "3.0.0rc4",
- "jade": "*"
+ "jade": "*",
+ "nconf": "~0.6.4"
}
-}
+}
View
@@ -0,0 +1,19 @@
+module.exports = function (app) {
+
+ // home page
+ app.get('/', function (req, res) {
+ res.render('index', { title: 'Home Page. ' })
+ });
+
+ // instagram get
+ app.get('/newimage/:city', function (req, res) {
+ // http://your-callback.com/url/?hub.mode=subscribe&hub.challenge=15f7d1a91c1f40f8a748fd134752feb3&hub.verify_token=myVerifyToken
+
+ console.log(req.params.city);
+ console.log(req.query['hub.challenge']);
+ console.log(req.query['hub.mode']);
+ console.log(req.query['hub.verify_token']);
+
+ res.send(req.query['hub.challenge']);
+ });
+}
View
@@ -1,8 +0,0 @@
-
-/*
- * GET home page.
- */
-
-exports.index = function(req, res){
- res.render('index', { title: 'Express' });
-};
View
@@ -1,8 +0,0 @@
-
-/*
- * GET users listing.
- */
-
-exports.list = function(req, res){
- res.send("respond with a resource");
-};
View
@@ -3,11 +3,14 @@
* Module dependencies.
*/
-var express = require('express')
- , routes = require('./routes')
- , user = require('./routes/user')
+var express = require('express')
, http = require('http')
- , path = require('path');
+ , path = require('path')
+ , nconf = require('nconf');
+
+nconf.argv().env().file('keys.json');
+
+//console.log(nconf.get('instagramClientId'));
var app = express();
@@ -27,8 +30,7 @@ app.configure('development', function(){
app.use(express.errorHandler());
});
-app.get('/', routes.index);
-app.get('/users', user.list);
+require('./routes/home')(app);
http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
View
@@ -61,6 +61,6 @@
enableXFF="false"
promoteServerVars=""
/>-->
-
+ <iisnode watchedFiles="*.js;node_modules\*;routes\*.js;views\*.jade;middleware\*.js;iisnode.yml"/>
</system.webServer>
</configuration>

0 comments on commit 27241d0

Please sign in to comment.