Skip to content

Commit fbf6343

Browse files
Updated layouts
1 parent 8a30bf8 commit fbf6343

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

index.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1-
const express=require('express');
2-
const bodyParser=require('body-parser');
3-
const ejs=require('ejs');
1+
const express = require('express');
2+
const bodyParser = require('body-parser');
3+
const ejs = require('ejs');
44
require('dotenv').config();
55

6-
var port=process.env.PORT || 8080;
6+
var port = process.env.PORT || 8080;
77

8-
var posts=["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.","Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."];
9-
var postTitles=["First Blog Post","Second Blog Post"];
8+
var posts = ["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book... ", "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book... "];
9+
var postTitles = ["First Blog Post", "Second Blog Post"];
1010
// const homeContent;
1111
// const aboutContent;
1212

1313

1414
// Initialize Express
15-
const app=express();
15+
const app = express();
1616

1717
// Setting up template engine
18-
app.set('view engine','ejs');
18+
app.set('view engine', 'ejs');
1919

2020
// bodyParser Initialized
21-
app.use(bodyParser.urlencoded({extended:true}));
21+
app.use(bodyParser.urlencoded({
22+
extended: true
23+
}));
2224

2325
//Static Files Served
24-
app.use('/public',express.static('public'));
26+
app.use('/public', express.static('public'));
2527

2628
// Home Route
27-
app.get('/',(req,res)=>{
28-
res.render("home.ejs",{posts:posts,title:postTitles});
29+
app.get('/', (req, res) => {
30+
res.render("home.ejs", {
31+
posts: posts,
32+
title: postTitles
33+
});
2934
});
3035

3136

32-
app.listen(port, ()=>{
33-
console.log("Server Up At "+port);
37+
app.listen(port, () => {
38+
console.log("Server Up At " + port);
3439
});

0 commit comments

Comments
 (0)