Server exposing the API for the tripmemore applications
Uses nodeJS with expressJS and mongoDB
Based on a lot of information found on http://scotch.io/tutorials/javascript/build-a-restful-api-using-node-and-express-4
Simply run
npm install
bower install
gulp
The package.json file contains everything you need
Don't forget to setup your details in config/
Run the server with
node server.js
Then point your browser at http://localhost:8080
Some basic views are visible from /, doing authentication using local signup, twitter and facebook oauth.
The available routes for the are
Return the list of pins. Two filters are available :
GET /api/pins/?user_id=plop&keyword=truc returns the list filtered by user_id, where any of the place contains 'truc'
### POST /api/pins/
Save a pin. Use postman for your tests !
Fetches and return a pin by id
## Pin schema
Data are stored like this inside mongoDb :
var PinSchema = new Schema({ origin: String, date : { type : Date, default : Date.now }, place: Schema.Types.Mixed, media: Schema.Types.Mixed });
with media being something like this : { type: String, content: String } and place being the result of a query from google place autocomple, as seen in the demo/search.html file link to the project