Permalink
Browse files

Initial commit server

X
  • Loading branch information...
fabianhjr committed Dec 13, 2012
1 parent e59ad71 commit 5bc2d0558c05284caf3d2f8bc60d12e176dfd35c
Showing with 39 additions and 0 deletions.
  1. +30 −0 server/app.js
  2. +9 −0 server/package.json
View
@@ -0,0 +1,30 @@
+var express = require("express");
+var app = express();
+
+var saveReport = function(report){
+ // Saves the report
+ return 0;
+};
+
+// POST Datos
+app.get('/newreport', function(req, res){
+ try {
+ var report = {
+ image: req.files.image,
+ location: req.body.location,
+ time: req.body.time,
+ type: req.body.type
+ };
+ var reportid = saveReport(report);
+ res.status(200);
+ res.json({id: reportid});
+
+ } catch (err) {
+ console.log(err);
+ res.status(500);
+ res.json(req.params);
+ }
+});
+
+app.listen(8080);
+console.log('Listening on port: 8080');
View
@@ -0,0 +1,9 @@
+{
+ "name": "ReporteGDG",
+ "description": "Reportes de emergencias",
+ "version": "0.0.1",
+ "private": true,
+ "dependencies": {
+ "express": "3.x"
+ }
+}

0 comments on commit 5bc2d05

Please sign in to comment.