-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp9_1.js
More file actions
34 lines (19 loc) · 736 Bytes
/
app9_1.js
File metadata and controls
34 lines (19 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var express=require('express');
var app=express();
var port= process.env.PORT||3000;
app.use('/assets',express.static(__dirname+'//public'));
app.set('view engine','ejs');
app.use('/',function(req,res,next){
console.log(req.url+'\n');
next();
});
app.get('/',function(req,res){
res.render('index',{adi:'kasım ergün',QSTR:req.query.qstr});
//res.send('<html><head><link href=assets/styles.css type=text/css rel=stylesheet /></head><body><h1>dashdahsh</h1><p>This is a paragraph.</p></body></html>');
}
);
app.get('/person/:id',function(req,res){
res.send('<html><head><title>Page Title</title></head><body><h1>hello person '+req.params.id+'</h1><p>This is a paragraph.</p></body></html>');
}
);
app.listen(port);