Skip to content
Merged
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
32 changes: 11 additions & 21 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
/*
// Importing required packages
const http = require('http');
const express = require('express');

GEREKLİ PAKETLER YÜKLENİYOR...
const app = express();

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

var http = require('http');
var express = require('express');
require('./app/routes')(app); // Routes are imported

var app = express();

app.set('port', process.env.PORT || 3000); // GİRİŞ PORTU AYARLANDI
app.set('views', __dirname + '/app/server/views'); // VIEW KLASÖRÜ TANITILDI
app.set('view engine', 'ejs'); // VIEW ENGINE AYARLANDI
app.use(express.static(__dirname + '/app/public')); // KULLANICILAR TARAFINDAN ERİŞİLEBİLEN KLASÖR TANIMLANDI

require('./app/routes')(app); // ROUTE DOSYASI ÇAĞIRILDI

/*

HTTP SERVER OLUŞTURULDU

*/
http.createServer(app).listen(app.get('port'), function(){
console.log('Sistem ' + app.get('port') + ' Portu Üzerinde Çalışıyor.');
});
console.log('The application is running on port ' + app.get('port'));
}); // Http server is created
9 changes: 4 additions & 5 deletions app/public/styles/styles.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*

STİL KODLARINI BURAYA YAZABİLİRSİNİZ.

*/
/* Custom styles can be added to this file */
span {
font-size: 50px;
}
6 changes: 2 additions & 4 deletions app/routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module.exports = function(app) {

app.get('/',function(req,res){ // İSTEMCİNİN '/' İSTEĞİNE KARŞILIK VEREN KOD BLOĞU
res.render('index'); // INDEX VİEW DOSYASI RENDER EDİLDİ
app.get('/', function(req, res){
res.render('index'); // index view file is rendered when HTTP GET '/' called
});

}
5 changes: 3 additions & 2 deletions app/server/views/index.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles/styles.css" />
<title>Sample Node.js Application</title>
</head>
<body>
Örnek Node.js Projesi
<span>Sample Node.js Application</span>
</body>
</html>