Skip to content

Commit

Permalink
Add POST geoPosition route #1
Browse files Browse the repository at this point in the history
  • Loading branch information
brnrdog committed Apr 14, 2014
1 parent 81560fe commit 1145a55
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
var express = require('express');
var app = express();
var db = require('db.js');
var geoPosition = require('app/models/geo_position.js');

app.get('/', function(req, res){
res.send('hello world');
res.send('hello world');
});

app.post('/geo-position', function(req, res) {
var lat = req.query.lat,
lng = req.query.lng;
geoPosition.create({
lat: lat,
lng: lng
}, function(err, geoPosition) {
if (err) {
res.send(err);
} else {
res.json(geoPosition);
}
});
});

app.listen(3000);

0 comments on commit 1145a55

Please sign in to comment.