@@ -3,8 +3,7 @@ import request from 'request';
33import express from 'express' ;
44import bodyParser from 'body-parser' ;
55import { encryptAES , decryptAES } from './crypto.js' ;
6- import { data as currencyCodes } from 'currency-codes' ;
7- import awssdk from 'aws-sdk' ;
6+
87
98// application secrets
109import { keys } from './config/keys.js' ;
@@ -15,26 +14,9 @@ import { router as currencyExchangeRoutes } from './routes/currency-exchange-rou
1514// routes handler for WeatherBit.io API methods
1615import { router as weatherbitRoutes } from './routes/weatherbit-routes.js' ;
1716
18- let WEATHERBIT_KEY = "" ;
19- let WEATHERBIT_URI = "" ;
20-
17+ // dev env
2118dotenv . config ( ) ;
2219
23- if ( process . env . NODE_ENV === 'awsdeploy' ) {
24- WEATHERBIT_URI = "https://api.weatherbit.io/v2.0/" ;
25- WEATHERBIT_KEY = "U2FsdGVkX18HMV5UUT9rJN76hOtIHDw1bH0beQYWH8a6E7uzKqskdgHvc6Nq2lO6O+GAb2vrcL+X8ZDqcGPuLw==" ;
26- console . log ( "AWSDEPLOY mode!" ) ;
27- } else {
28- // Code for Development Mode
29- // WEATHERBIT_KEY = process.env.WEATHERBIT_KEY;
30- // WEATHERBIT_URI = process.env.WEATHERBIT_URI;
31-
32- WEATHERBIT_KEY = keys . weatherbitapi . APIKEY ;
33- WEATHERBIT_URI = keys . weatherbitapi . URI ;
34- }
35-
36-
37-
3820// Create network routing
3921const app = express ( ) ;
4022
@@ -55,8 +37,7 @@ app.use('/weatherbit', weatherbitRoutes);
5537
5638// Homepage: get the locale from the client-side via the ejs form
5739app . get ( '/' , ( req , res ) => {
58- let apikey = encryptAES ( WEATHERBIT_KEY ) ;
59- res . render ( 'index' , { xkey : apikey } ) ;
40+ res . render ( 'index' , { xkey : 'hey' } ) ;
6041} )
6142
6243// about page
0 commit comments