Skip to content

Practice #96

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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b3abd74
[imad-console] Updates ui/index.html
sagarbhaltilak Aug 20, 2017
11dd3f8
Update index.html
sagarbhaltilak Aug 20, 2017
727143f
[imad-console] Updates ui/index.html
sagarbhaltilak Aug 21, 2017
6fe783a
[imad-console] Updates server.js
sagarbhaltilak Aug 21, 2017
5f4190e
[imad-console] Updates server.js
sagarbhaltilak Aug 21, 2017
367f015
Create article-one.html
sagarbhaltilak Aug 21, 2017
e7b9b1f
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
868a37d
[imad-console] Updates server.js
sagarbhaltilak Aug 21, 2017
da83ead
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
8ab7812
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
c367b2c
Create article-two.html
sagarbhaltilak Aug 21, 2017
2ef94df
Create article-three.html
sagarbhaltilak Aug 21, 2017
8042147
[imad-console] Updates server.js
sagarbhaltilak Aug 21, 2017
c678401
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
ee503b9
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
6b39a70
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
77597fb
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
17cc3ea
[imad-console] Updates ui/article-three.html
sagarbhaltilak Aug 21, 2017
7eb3ec5
[imad-console] Updates ui/article-two.html
sagarbhaltilak Aug 21, 2017
89712b8
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
9c73677
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
f331e26
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
ad023ee
[imad-console] Updates ui/style.css
sagarbhaltilak Aug 21, 2017
c545cc8
[imad-console] Updates ui/article-one.html
sagarbhaltilak Aug 21, 2017
d30710c
[imad-console] Updates ui/article-three.html
sagarbhaltilak Aug 21, 2017
eadf30f
[imad-console] Updates ui/article-two.html
sagarbhaltilak Aug 21, 2017
98a2fa6
[imad-console] Updates server.js
sagarbhaltilak Aug 21, 2017
17c3b79
[imad-console] Updates ui/index.html
sagarbhaltilak Aug 24, 2017
4eb79a8
[imad-console] Updates server.js
sagarbhaltilak Aug 24, 2017
0406ace
[imad-console] Updates server.js
sagarbhaltilak Aug 24, 2017
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
62 changes: 62 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,74 @@ var path = require('path');
var app = express();
app.use(morgan('combined'));

var articleone={
title:"article one by sagar bhaltilak",
heading:"article-one",
date:"aug 5 2017",
content:`
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>`};

function createTemplate(data){
var title=data.title;
var date=data.date;
var heading=data.heading;
var content=data.content;
var htmlTemplate=`<!doctype html>
<head>
<title>${title}</title>
<meta name="viewport" content="width-device-width intial-scale-1"/>
<link href="/ui/style.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div>
<a href="/">home</a>
</div>
<hr/>
<h3>${heading}</h3>
<div>
${date}
</div>
<div>
${content}
</div>
</div>
</body>
</html>`;

return htmlTemplate;
}

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

app.get('/article-one',function(req,res){
res.send(createTemplate(articleone));
});

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

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

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

app.get('/ui/madi.png', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'madi.png'));
Expand All @@ -25,3 +86,4 @@ var port = 80;
app.listen(port, function () {
console.log(`IMAD course app listening on port ${port}!`);
});

30 changes: 30 additions & 0 deletions ui/article-one.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<head>
<title>Article one</title>
<meta name="viewport" content="width-device-width intial-scale-1"/>
<link href="/ui/style.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div>
<a href="/">home</a>
</div>
<hr/>
<h3>Article-one</h3>
<div>
aug 21 2017
</div>
<div>
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
</div>
</div>
</body>
</html>
30 changes: 30 additions & 0 deletions ui/article-three.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<head>
<title>Article three</title>
<meta name="viewport" content="width-device-width intial-scale-1"/>
<link href="/ui/style.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div>
<a href="/">home</a>
</div>
<hr/>
<h3>Article-three</h3>
<div>
aug 21 2017
</div>
<div>
<p>
This is my three article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my three article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my three article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
</div>
</div>
</body>
</html>
30 changes: 30 additions & 0 deletions ui/article-two.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<head>
<title>Article two</title>
<meta name="viewport" content="width-device-width intial-scale-1"/>
<link href="/ui/style.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div>
<a href="/">home</a>
</div>
<hr/>
<h3>Article-two</h3>
<div>
aug 21 2017
</div>
<div>
<p>
This is my second article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
<p>
This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.This is my first article and i am feeling great to do this.
</p>
</div>
</div>
</body>
</html>
8 changes: 7 additions & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
</div>
<br>
<div class="center text-big bold">
Hi! I am your webapp.
Hi! I am sagar and this is my first web app.
</div>
<div class="center"><h2>
its looking good</h2>
</div>
<script>
alert("hiii this is a javascript")
</script>
<script type="text/javascript" src="/ui/main.js">
</script>
</body>
Expand Down
9 changes: 9 additions & 0 deletions ui/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ body {
.img-medium {
height: 200px;
}
.container
{
max-width:800px;
margin:0 auto;
color:grey;
font-family:sans-serif;
padding-top:60px;
padding-left:20px;
}