Add support for API without using old Python URL

This commit is contained in:
Samer Albahra
2015-07-06 13:31:23 -05:00
parent e5e9b242c8
commit b489324425

View File

@@ -22,6 +22,7 @@ mongoose.connection.on( "error", function() {
// weather adjustment method selector. // weather adjustment method selector.
// This endpoint is considered deprecated and supported for prior firmware // This endpoint is considered deprecated and supported for prior firmware
app.get( /weather(\d+)\.py/, weather.getWeather ); app.get( /weather(\d+)\.py/, weather.getWeather );
app.get( /(\d+)/, weather.getWeather );
// Handle 404 error // Handle 404 error
app.use( function( req, res ) { app.use( function( req, res ) {
@@ -42,7 +43,7 @@ new CronJob( "0 0 0 * * *", function() {
Cache.find( {}, function( err, records ) { Cache.find( {}, function( err, records ) {
// Cycle through each record // Cycle through each record
records.forEach( function( record ){ records.forEach( function( record ) {
// If the record contains any unaveraged data, then process the record // If the record contains any unaveraged data, then process the record
if ( record.currentHumidityCount > 0 ) { if ( record.currentHumidityCount > 0 ) {