File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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- */
2414http . 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
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 11module . 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}
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments