Skip to content

Commit

Permalink
Project was publish
Browse files Browse the repository at this point in the history
  • Loading branch information
acemilyalcin committed Feb 16, 2018
0 parents commit 4864cc1
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
25 changes: 25 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
GEREKLİ PAKETLER YÜKLENİYOR...
*/
var http = require('http');
var express = require('express');

var app = express();

app.set('port', process.env.PORT || 3005); // 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.');
});
5 changes: 5 additions & 0 deletions app/public/styles/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
STİL KODLARINI BURAYA YAZABİLİRSİNİZ.
*/
7 changes: 7 additions & 0 deletions app/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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İ
});

}
8 changes: 8 additions & 0 deletions app/server/views/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<link rel="stylesheet" href="styles/styles.css" />
</head>
<body>
Örnek Node.js Projesi
</body>
</html>
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "sample-node-project",
"version": "1.0.0",
"description": "Sample Node.js Project",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Adem Cemil YALCIN",
"license": "ISC"
}
16 changes: 16 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Sample Node.js Project

A Node.js project written using Express. EJS was used as the view engine.

# Installation

You need to write the following commands on the terminal screen so that you can run the project locally.

<code>
git clone [email protected]:acemilyalcin/sample-node-project
cd sample-node-project
npm install
npm start
</code>

The application is running on [Title](localhost:3000)

0 comments on commit 4864cc1

Please sign in to comment.