这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node_modules/
node_modules/
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +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"
}
}
{
"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"
}
}
14 changes: 13 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'index.html'));
});

app.get('/article-1', function(req,res) {
res.send('Article one will be found here');
});

app.get('/article-2', function(req,res) {
res.send('Article two will be found here');
});

app.get('/article-3', function(req,res) {
res.send('Article three will be found here');
});

app.get('/ui/style.css', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'style.css'));
});
Expand All @@ -21,4 +33,4 @@ app.get('/ui/madi.png', function (req, res) {
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}!`);
});
});
3 changes: 3 additions & 0 deletions ui/article-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
</html>
35 changes: 18 additions & 17 deletions ui/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<!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>
<!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 Tijo. This will be awesome
<h4 style="font-family:cursive; color:gold">Building this up!</h4>
</div>
<script type="text/javascript" src="/ui/main.js">
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion ui/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
console.log('Loaded!');
console.log('Loaded!');
44 changes: 22 additions & 22 deletions ui/style.css
Original file line number Diff line number Diff line change
@@ -1,22 +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;
}

body {
font-family: sans-serif;
background-color: white;
margin-top: 75px;
}
.center {
text-align: center;
}
.text-big {
font-size: 300%;
}
.bold {
font-weight: bold;
}
.img-medium {
height: 200px;
}