aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Damani <kumar.damani@mail.utoronto.ca>2019-02-27 05:27:26 +0000
committerKumar Damani <kumar.damani@mail.utoronto.ca>2019-02-27 05:27:26 +0000
commitfdb6e5c171da5ebaf91d09c84647d95ce4e530ca (patch)
tree5ae4e4c3ea4b1b453e325cba987b0e1e5b6eadb2
parent92625bb842d80faa33188306b918f2078c91e848 (diff)
fixed spaces to indents
-rw-r--r--web/public/javascripts/map.js12
-rw-r--r--web/routes/index.js43
2 files changed, 26 insertions, 29 deletions
diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js
index 414efee..d2afeb4 100644
--- a/web/public/javascripts/map.js
+++ b/web/public/javascripts/map.js
@@ -5,17 +5,15 @@
// different basemap
L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}', {
- attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
- subdomains: 'abcd',
- minZoom: 0,
- maxZoom: 13,
- ext: 'png'
+ attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
+ subdomains: 'abcd',
+ minZoom: 0,
+ maxZoom: 13,
+ ext: 'png'
}).addTo(map);
// Create point feature for somewhere downtown
var myDataPoint = L.marker([43.6529, -79.3849]).addTo(map);
// Bind popup to Data Point object
-// myDataPoint.bindPopup("This is my city");
-// i can add regular html to this too - neat!
myDataPoint.bindPopup("<h3>City Hall (not really)</h3><p>Toronto, ON<br>Information about city hall.</p>");
diff --git a/web/routes/index.js b/web/routes/index.js
index 3aaee01..df579fc 100644
--- a/web/routes/index.js
+++ b/web/routes/index.js
@@ -7,32 +7,32 @@ var mongoose = require('mongoose');
var env = process.env.NODE_ENV || 'development';
var uri;
if (env === 'development') {
- uri = 'mongodb://localhost:27017/helpthehome'
- // use for small testing only if really necessary
- // uri = 'mongodb+srv://development:dreamteam@cluster0-krnr4.mongodb.net/helpthehome?retryWrites=true'
+ uri = 'mongodb://localhost:27017/helpthehome'
+ // use for small testing only if really necessary
+ // uri = 'mongodb+srv://development:dreamteam@cluster0-krnr4.mongodb.net/helpthehome?retryWrites=true'
} else if (env === 'qa') {
- uri = process.env.MONGODB_URI
+ uri = process.env.MONGODB_URI
} else if (env === 'production') {
- uri = ''
+ uri = ''
}
// Mongoose connection to MongoDB
mongoose.connect(uri, { useNewUrlParser: true }, function (error) {
- if (error) {
- console.log(error);
- console.log("App was not able to connect to the mongo server!");
- console.log("... double check that the mongo server is running locally");
- } else {
+ if (error) {
+ console.log(error);
+ console.log("App was not able to connect to the mongo server!");
+ console.log("... double check that the mongo server is running locally");
+ } else {
console.log(`connected to ${uri}`);
- }
+ }
});
// Mongoose Schema definition
var Schema = mongoose.Schema;
var JsonSchema = new Schema({
- name: String,
- type: Schema.Types.Mixed,
- coordinates: Array
+ name: String,
+ type: Schema.Types.Mixed,
+ coordinates: Array
});
// Mongoose Model definition
@@ -40,19 +40,18 @@ var Json = mongoose.model('Jstring', JsonSchema, 'pointscollection');
/* GET home page. */
router.get('/', function(req, res, next) {
- // for now just redirect to /map
- //res.render('index', { title: 'Welcome' });
- res.redirect('/map');
+ // for now just redirect to /map
+ //res.render('index', { title: 'Welcome' });
+ res.redirect('/map');
});
/* GET Map page. */
router.get('/map', function(req,res) {
// send the view lat, and long. city center
- res.render('map', {
- lat : 43.654127,
- lng : -79.383370
- });
- });
+ res.render('map', {
+ lat : 43.654127,
+ lng : -79.383370
+ });
});
module.exports = router;