Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shahidhk committed Jan 26, 2017
0 parents commit 187a33f
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# imad-app-v2

Base repository for IMAD V2 course application. All users will fork this repo to create their own application.

PLEASE DO NOT submit PRs, or push to this git repository!
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "imad-2016-base",
"version": "0.1.0",
"description": "IMAD 2016 course app",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.14.0",
"morgan": "^1.7.0"
}
}
24 changes: 24 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var express = require('express');
var morgan = require('morgan');
var path = require('path');

var app = express();
app.use(morgan('combined'));

app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'index.html'));
});

app.get('/ui/style.css', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'style.css'));
});

app.get('/ui/madi.png', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'madi.png'));
});


var port = 8080; // Use 8080 for local development because you might already have apache running on 80
app.listen(8080, function () {
console.log(`IMAD course app listening on port ${port}!`);
});
17 changes: 17 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html>
<head>
<link href="/ui/style.css" rel="stylesheet" />
</head>
<body>
<div class="center">
<img src="/ui/madi.png" class="img-medium"/>
</div>
<br>
<div class="center text-big bold">
Hi! I am your webapp.
</div>
<script type="text/javascript" src="/ui/main.js">
</script>
</body>
</html>
Binary file added ui/madi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ui/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Loaded!');
22 changes: 22 additions & 0 deletions ui/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
body {
font-family: sans-serif;
background-color: lightgrey;
margin-top: 75px;
}

.center {
text-align: center;
}

.text-big {
font-size: 300%;
}

.bold {
font-weight: bold;
}

.img-medium {
height: 200px;
}

0 comments on commit 187a33f

Please sign in to comment.