Skip to content

Commit 3c90c6a

Browse files
authored
Merge pull request #22 from acemilyalcin/improve-comments
Improved the comments
2 parents 0851f79 + 03a3141 commit 3c90c6a

4 files changed

Lines changed: 20 additions & 32 deletions

File tree

app.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
1-
/*
1+
// Importing required packages
2+
const http = require('http');
3+
const express = require('express');
24

3-
GEREKLİ PAKETLER YÜKLENİYOR...
5+
const app = express();
46

5-
*/
7+
app.set('port', process.env.PORT || 3000); // Application port is set
8+
app.set('views', __dirname + '/app/server/views'); // Views folder is set
9+
app.set('view engine', 'ejs'); // View engine is set
10+
app.use(express.static(__dirname + '/app/public')); // Public folder containing static files is set
611

7-
var http = require('http');
8-
var express = require('express');
12+
require('./app/routes')(app); // Routes are imported
913

10-
var app = express();
11-
12-
app.set('port', process.env.PORT || 3000); // GİRİŞ PORTU AYARLANDI
13-
app.set('views', __dirname + '/app/server/views'); // VIEW KLASÖRÜ TANITILDI
14-
app.set('view engine', 'ejs'); // VIEW ENGINE AYARLANDI
15-
app.use(express.static(__dirname + '/app/public')); // KULLANICILAR TARAFINDAN ERİŞİLEBİLEN KLASÖR TANIMLANDI
16-
17-
require('./app/routes')(app); // ROUTE DOSYASI ÇAĞIRILDI
18-
19-
/*
20-
21-
HTTP SERVER OLUŞTURULDU
22-
23-
*/
2414
http.createServer(app).listen(app.get('port'), function(){
25-
console.log('Sistem ' + app.get('port') + ' Portu Üzerinde Çalışıyor.');
26-
});
15+
console.log('The application is running on port ' + app.get('port'));
16+
}); // Http server is created

app/public/styles/styles.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/*
2-
3-
STİL KODLARINI BURAYA YAZABİLİRSİNİZ.
4-
5-
*/
1+
/* Custom styles can be added to this file */
2+
span {
3+
font-size: 50px;
4+
}

app/routes.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module.exports = function(app) {
2-
3-
app.get('/',function(req,res){ // İSTEMCİNİN '/' İSTEĞİNE KARŞILIK VEREN KOD BLOĞU
4-
res.render('index'); // INDEX VİEW DOSYASI RENDER EDİLDİ
2+
app.get('/', function(req, res){
3+
res.render('index'); // index view file is rendered when HTTP GET '/' called
54
});
6-
75
}

app/server/views/index.ejs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<html>
1+
<html lang="en">
22
<head>
33
<link rel="stylesheet" href="styles/styles.css" />
4+
<title>Sample Node.js Application</title>
45
</head>
56
<body>
6-
Örnek Node.js Projesi
7+
<span>Sample Node.js Application</span>
78
</body>
89
</html>

0 commit comments

Comments
 (0)