Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made First Change #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added project/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions project/html/helpers/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

<!-- then bootstrap -->
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<!-- api key for open weather-->
<script>var apiKey="<%= process.env.API_KEY %>";</script>

<!-- then our app's own js file -->
<script src="js/main.js"></script>
5 changes: 5 additions & 0 deletions project/html/helpers/navbar.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul class="nav">
<li class="nav-item"><a class="nav-link" href="/">Home</a></li>
<li class="nav-item"><a class="nav-link" href="/about">About</a></li>
<li class="nav-item"><a class="nav-link" href="/projects">Projects</a></li>
</ul>
24 changes: 24 additions & 0 deletions project/html/pages/about.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<html lang="en">
<head>
<% include ../helpers/head %>
<% include ../helpers/navbar %>
</head>

<body>
<!-- the classes 'page-header' and 'btn btn-dark' create bootstrap components. -->
<!-- Check out more components here: http://getbootstrap.com/components/ -->
<div class="page-header">


<h1>Markquart Motors About</h1>
</div>

<p>Click on the button for a surprise.</p>

<button onClick="showPicture()" class="btn btn-dark">Click me</button>

<div id="image"></div>

</body>

</html>
10 changes: 4 additions & 6 deletions project/html/pages/index.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<html lang="en">
<head>
<% include ../helpers/head %>
<% include ../helpers/navbar %>
</head>

<body>
Expand All @@ -9,15 +10,12 @@
<div class="page-header">


<h1>My Web App</h1>
<h1>Markquart Weather Web Application</h1>
</div>

<p>Click on the button for a surprise.</p>
<div class="city"></div>
<div class="temp"></div>

<button onClick="showPicture()" class="btn btn-dark">Click me</button>

<div id="image"></div>

</body>

</html>
26 changes: 26 additions & 0 deletions project/html/pages/index.ejs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<html lang="en">
<head>
<% include ../helpers/head %>
<% include ../helpers/navbar %>
</head>

<body>
<!-- the classes 'page-header' and 'btn btn-dark' create bootstrap components. -->
<!-- Check out more components here: http://getbootstrap.com/components/ -->
<div class="page-header">


<h1>Markquart Motors Weather Web Application</h1>
</div>
<div class="city"></div>
<div class="temp"></div>

<p>Click on the button for a surprise.</p>

<button onClick="showPicture()" class="btn btn-dark">Click me</button>

<div id="image"></div>

</body>

</html>
24 changes: 24 additions & 0 deletions project/html/pages/projects.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<html lang="en">
<head>
<% include ../helpers/head %>
<% include ../helpers/navbar %>
</head>

<body>
<!-- the classes 'page-header' and 'btn btn-dark' create bootstrap components. -->
<!-- Check out more components here: http://getbootstrap.com/components/ -->
<div class="page-header">


<h1>Markquart Motors Projects</h1>
</div>

<p>Click on the button for a surprise.</p>

<button onClick="showPicture()" class="btn btn-dark">Click me</button>

<div id="image"></div>

</body>

</html>
Binary file added project/images/favicon.ico
Binary file not shown.
15 changes: 14 additions & 1 deletion project/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,18 @@ function showPicture(){
$("p").html("High five! You're building your first web app!");

// jQuery can do a lot of crazy stuff, so make sure to Google around to find out more


}
$(document).ready(function(){
getWeather();
})
function getWeather() {
var url = "https://api.openweathermap.org/data/2.5/weather?q=Boston&units=imperial&APPID="+apiKey;
//23aa55a6b3d574a81b14488e59089627";
//"+apiKey

$.ajax(url,{success: function(data){
//shows data in javascript console log for debugging.
console.log(data);
}})
}
6 changes: 6 additions & 0 deletions project/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ app.set('view engine', 'ejs');
app.get('/', function(request, response) {
response.render('pages/index');
});
app.get('/about', function(request, response) {
response.render('pages/about');
});
app.get('/projects', function(request, response) {
response.render('pages/projects');
});

app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
Expand Down