-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mustakim & Shubham - created initial setup.
What changes have you made? * created server and homepage.
- Loading branch information
Showing
8 changed files
with
144 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html> | ||
<head> | ||
<title>Cash Flow</title> | ||
<link rel="stylesheet" type="text/css" href="/homepage.css" /> | ||
</head> | ||
<body> | ||
<header>Cash Flow | ||
<p>Get out of the Rat Race !</p> | ||
</header> | ||
<main> | ||
<section id="gameOptionsField" class="game-options-field"> | ||
<button id="hostGame" class="game-options">Host Game</button> | ||
<button id="joinGame" class="game-options">Join Game</button> | ||
<button id="instructions" class="game-options">Instructions</button> | ||
<button id="about" class="game-options">About</button> | ||
</section> | ||
<section class="logo">Image</section> | ||
</main> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
html, | ||
body { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
header { | ||
font-size: 40px; | ||
height: 20%; | ||
text-align: center; | ||
} | ||
p { | ||
font-size: 30px; | ||
} | ||
main { | ||
height: 80%; | ||
width: 100%; | ||
border: 1px solid black; | ||
display: flex; | ||
justify-content: space-around; | ||
align-items: center; | ||
} | ||
.game-options-field { | ||
width: 40%; | ||
height: 80%; | ||
border: 1px solid black; | ||
border-radius: 5%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
box-shadow: 10px 10px 10px rgb(128, 124, 124); | ||
} | ||
.logo { | ||
width: 40%; | ||
height: 80%; | ||
border: 1px solid black; | ||
border-radius: 5%; | ||
box-shadow: 10px 10px 10px rgb(128, 124, 124); | ||
} | ||
.game-options { | ||
width: 50%; | ||
height: 10%; | ||
border-radius: 50vmax; | ||
margin: 10px; | ||
font-size: 20px; | ||
box-shadow: 10px 10px 10px rgb(128, 124, 124); | ||
} | ||
.player-name { | ||
width: 50%; | ||
height: 10%; | ||
border-radius: 25%; | ||
margin: 10px; | ||
font-size: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const http = require('http'); | ||
const app = require('./src/app.js'); | ||
|
||
const server = http.createServer(app); | ||
const PORT = process.env.PORT || 8081; | ||
server.listen(PORT); | ||
|
||
console.log('Server listening at port ', PORT); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const express = require('express'); | ||
const app = express(); | ||
const {renderHomePage, logRequest} = require('./handlers.js'); | ||
|
||
app.use(logRequest); | ||
app.get('/', renderHomePage); | ||
app.use(express.static('public/pages')); | ||
app.use(express.static('public/scripts')); | ||
app.use(express.static('public/stylesheets')); | ||
module.exports = app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const renderHomePage = function(req, res) { | ||
res.redirect('/homepage.html'); | ||
}; | ||
|
||
const logRequest = function(req, res, next) { | ||
console.log('URL --> ', req.url); | ||
console.log('Method --> ', req.method); | ||
next(); | ||
}; | ||
|
||
module.exports = {renderHomePage, logRequest}; |