Skip to content

Commit 0caba02

Browse files
committed
new file: .dockerignore
modified: Dockerfile modified: README.md modified: index.js modified: views/index.ejs modified: views/pages/about.ejs
1 parent c00eb4f commit 0caba02

File tree

6 files changed

+37
-29
lines changed

6 files changed

+37
-29
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**/node_modules/
2+
**/.git
3+
**/README.md
4+
**/LICENSE
5+
**/.vscode
6+
**/npm-debug.log
7+
**/coverage
8+
**/.env
9+
**/.editorconfig
10+
**/.aws
11+
**/dist

Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
FROM node:16.17.0
1+
FROM node:16.17.0 AS build
22

3-
WORKDIR /app
4-
5-
COPY package.json ./
6-
7-
RUN npm install
3+
WORKDIR /usr/src/app
84

5+
#COPY package.json package-lock.json ./
96
COPY . .
107

8+
# install package.json and clean cache.
9+
RUN npm ci --production && npm cache clean --force
10+
1111
ENV NODE_ENV=production
1212
ENV PORT=8080
13-
ENV WEATHER_VISUALCROSSING_API_BASE_URI_4LNG_LAT=https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/forecast?aggregateHours=24&contentType=json&unitGroup=us
14-
ENV WEATHER_VISUALCROSSING_API_BASE_URI=https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/
1513
ENV WEATHERBIT_URI=https://api.weatherbit.io/v2.0/
16-
# ENV WEATHER_VISUALCROSSING_API_KEY=XXXXX
17-
# ENV WEATHERBIT_KEY=XXXXXXX
14+
15+
# ENV WEATHERBIT_KEY=XXXXXXX <-- expect as container parameter!
1816

1917
EXPOSE 8080
2018

21-
CMD [ "npm", "start" ]
19+
CMD [ "node", "index.js" ]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ It is a typical NodeJS project layout.
9696

9797
`npm start`
9898

99-
>Initially, the browser might pop up asking if you would allow it to detect your location. An 'Allow' will enable GPS pinpoint weather report. A 'Block' will disable GPS for current and subsequent session.
99+
>Initially, the browser might pop up asking if you would allow it to detect your location. An 'Allow' will enable GPS pinpoint weather report. A 'Block' will disable GPS for current and subsequent sessions.
100100
101101
![Browser popup](./public/PermitGeolocation.PNG)
102102

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ app.get('/', (req, res) => {
2121
// console.dir(req.params);
2222
// console.dir(req.body);
2323
let apikey = encrypt(process.env.WEATHERBIT_KEY);
24-
res.render('index1', {xkey: apikey});
24+
res.render('index', {xkey: apikey});
2525
})
2626

2727

@@ -242,7 +242,7 @@ app.post('/', (req, res) => {
242242
});
243243

244244
} catch (err) {
245-
res.render('index1', { locale: city, data: null, forecast: null, error: err.message });
245+
res.render('index', { locale: city, data: null, forecast: null, error: err.message });
246246
}
247247
});
248248

views/index.ejs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,23 @@
1111
<title>TechRolEmi Weather42</title>
1212
</header>
1313
<body>
14-
<h1>Geolocation Pinpoint Weather</h1>
14+
<h1>Welcome weary net surffers!</h1>
1515
<div class="xcode" style="display: none;"></div>
1616
<input type="hidden" id="xcree" name="xcree" value="ZTg4ZTFhODA5NmNkNDg5N2I3OWIyMzBhOWM0OWIyNDM=">
1717
<div id="geoLatLng" action="showPosition()">
1818
<!-- pinpoint positon verbish will be loaded into here -->
1919
<!-- <p><%= xkey %></p> -->
2020
</div>
2121
<hr>
22-
<p>Weather information is powerful knowledge used in forecasting the production of certain operations to help determine the economic bottom line. There are countless human endeavors affected by weather factors. Rain is good for growers, and forewarning is valuable in extreme weather, while the sunny sky and windy days could be good for energy production. For example, solar power production needs to know the number of hours of sunlight specific to geographical location. Wind farm needs to know wind speed, direction, etc. The travel and hospitality industry is most affected by dynamic weather patterns. From agriculture to space-faring, weather plays a key role in the decision-making process.</p>
23-
<hr />
24-
<p>There are weather detection stations situated in and around you. The inner working of making data available is not of interest to the populous but it is vital to a functioning society. Although, the National Weather Service is a government agency that disseminates data free of charge. Weather data has been monetized by repackaging in ways the population can consume. e.g. Local TV news reserve a segment devoted to weather ubiquitously. Weather data is available at your fingertips. It is all factored into a transferable cost by some service providers you're currently paying. For weather application developers, the effective cost per thousand impressions (eCPM) metric is higher compared to educational apps. You can effectively monetize your project if you do it right.</p>
22+
<p>Whether you are at the beginning, somewhere in the middle, or nearign the end of your journey. Take the load off, sit down, look up. The weather is telling us something about our past actions. </p>
2523
<div>
26-
<hr>
27-
<br />
28-
<a href="https://github.com/hurricanemark/Weather_Report_NodeJS_EJS_Express_VisualCrossing_API" target="_blank">GitHub source</a>
29-
30-
<br />
31-
<a href="https://hub.docker.com/u/marknre" target = "_blank">Docker image</a>
32-
3324
<fieldset>
3425
<form action="/weatherbit" method="post">
3526
<input name="xcode" type="hidden" class="xcode" value="ZTg4ZTFhODA5NmNkNDg5N2I3OWIyMzBhOWM0OWIyNDM=" required>
3627
</form>
3728
</fieldset>
3829
</div>
3930

40-
4131
<main>
4232
<div class="currentConds"></div>
4333

views/pages/about.ejs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@
1515
<div class="row">
1616
<div class="col-sm-10">
1717
<div class="jumbotron jumbotron-fluid">
18-
<h1>Free Public Weather Report</h1>
19-
<p>Welcome to TechRolEmi LLC.</p>
18+
<h1>Public Weather Report</h1>
19+
<strong>Welcome to TechRolEmi LLC.</strong>
2020
<hr>
21-
<p>You could be surfing anywhere else, but you are here. We appreciate that.</p>
21+
<p>Weather information is powerful knowledge used in forecasting the production of certain operations to help determine the economic bottom line. There are countless human endeavors affected by weather factors. Rain is good for growers, and forewarning is valuable in extreme weather, while the sunny sky and windy days could be good for energy production. For example, solar power production needs to know the number of hours of sunlight specific to geographical location. Wind farm needs to know wind speed, direction, etc. The travel and hospitality industry is most affected by dynamic weather patterns. From agriculture to space-faring, weather plays a key role in the decision-making process.</p>
22+
<hr />
23+
<p>There are weather detection stations situated in and around you. The inner working of making data available is not of interest to the populous but it is vital to a functioning society. Although, the National Weather Service is a government agency that disseminates data free of charge. Weather data has been monetized by repackaging in ways the population can consume. e.g. Local TV news reserve a segment devoted to weather ubiquitously. Weather data is available at your fingertips. It is all factored into a transferable cost by some service providers you're currently paying. </p>
24+
<hr>
25+
<p>Support Ukraine.</p>
26+
<br />
27+
<a href="https://github.com/hurricanemark/Weather_Report_NodeJS_EJS_Express_VisualCrossing_API" target="_blank">GitHub source</a>
28+
29+
<br />
30+
<a href="https://hub.docker.com/u/marknre" target = "_blank">Docker image</a>
2231
</div>
2332
</div>
2433

0 commit comments

Comments
 (0)