Skip to content

Commit 187a33f

Browse files
committed
Initial commit
0 parents  commit 187a33f

File tree

7 files changed

+84
-0
lines changed

7 files changed

+84
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# imad-app-v2
2+
3+
Base repository for IMAD V2 course application. All users will fork this repo to create their own application.
4+
5+
PLEASE DO NOT submit PRs, or push to this git repository!

package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "imad-2016-base",
3+
"version": "0.1.0",
4+
"description": "IMAD 2016 course app",
5+
"main": "server.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"express": "^4.14.0",
13+
"morgan": "^1.7.0"
14+
}
15+
}

server.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var express = require('express');
2+
var morgan = require('morgan');
3+
var path = require('path');
4+
5+
var app = express();
6+
app.use(morgan('combined'));
7+
8+
app.get('/', function (req, res) {
9+
res.sendFile(path.join(__dirname, 'ui', 'index.html'));
10+
});
11+
12+
app.get('/ui/style.css', function (req, res) {
13+
res.sendFile(path.join(__dirname, 'ui', 'style.css'));
14+
});
15+
16+
app.get('/ui/madi.png', function (req, res) {
17+
res.sendFile(path.join(__dirname, 'ui', 'madi.png'));
18+
});
19+
20+
21+
var port = 8080; // Use 8080 for local development because you might already have apache running on 80
22+
app.listen(8080, function () {
23+
console.log(`IMAD course app listening on port ${port}!`);
24+
});

ui/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<link href="/ui/style.css" rel="stylesheet" />
5+
</head>
6+
<body>
7+
<div class="center">
8+
<img src="/ui/madi.png" class="img-medium"/>
9+
</div>
10+
<br>
11+
<div class="center text-big bold">
12+
Hi! I am your webapp.
13+
</div>
14+
<script type="text/javascript" src="/ui/main.js">
15+
</script>
16+
</body>
17+
</html>

ui/madi.png

13.6 KB
Loading

ui/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('Loaded!');

ui/style.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
body {
2+
font-family: sans-serif;
3+
background-color: lightgrey;
4+
margin-top: 75px;
5+
}
6+
7+
.center {
8+
text-align: center;
9+
}
10+
11+
.text-big {
12+
font-size: 300%;
13+
}
14+
15+
.bold {
16+
font-weight: bold;
17+
}
18+
19+
.img-medium {
20+
height: 200px;
21+
}
22+

0 commit comments

Comments
 (0)