Seperate OWM calls for App and OS

This commit is contained in:
Pete ba
2019-04-20 21:59:11 +01:00
parent 3984a31d09
commit bafdecccca
3 changed files with 87 additions and 59 deletions

View File

@@ -14,12 +14,12 @@ if ( !process.env.HOST || !process.env.PORT ) {
// Handle requests matching /weatherID.py where ID corresponds to the
// weather adjustment method selector.
// This endpoint is considered deprecated and supported for prior firmware
app.get( /weather(\d+)\.py/, weather.getWeather );
app.get( /(\d+)/, weather.getWeather );
app.get( /weather(\d+)\.py/, weather.getWateringData );
app.get( /(\d+)/, weather.getWateringData );
// Handle requests matching /weatherData
app.options( /weatherData/, cors() );
app.get( /weatherData/, cors(), weather.showWeatherData );
app.get( /weatherData/, cors(), weather.getWeatherData );
app.get( "/", function( req, res ) {
res.send( "OpenSprinkler Weather Service" );