Minjae1239

app.js updated

Showing 1 changed file with 56 additions and 28 deletions
...@@ -25,89 +25,117 @@ var kt = firstWsheet['P11']; ...@@ -25,89 +25,117 @@ var kt = firstWsheet['P11'];
25 25
26 app.get('/',function(req,res){ 26 app.get('/',function(req,res){
27 res.writeHead(200,{"Content-Type":"text/html"}); 27 res.writeHead(200,{"Content-Type":"text/html"});
28 - fs.createReadStream("./index.html").pipe(res); 28 + fs.createReadStream("./html/index.html").pipe(res);
29 +})
30 +
31 +app.get('/info',function(req,res){
32 + res.writeHead(200,{"Content-Type":"text/html"});
33 + fs.createReadStream("./html/info.html").pipe(res);
34 +})
35 +
36 +app.get('/vs',function(req,res){
37 + res.writeHead(200,{"Content-Type":"text/html"});
38 + fs.createReadStream("./html/vs.html").pipe(res);
29 }) 39 })
30 40
31 41
32 42
33 -app.get('/vs_lg',function(req,res){ 43 +app.get('/vs/lg',function(req,res){
34 if(lotte.v>lg.v){ 44 if(lotte.v>lg.v){
35 - res.send('Lotte VS LG : Lotte Win!'); 45 + res.writeHead(200,{"Content-Type":"text/html"});
46 + fs.createReadStream("./html/lg_l.html").pipe(res);
36 } 47 }
37 else{ 48 else{
38 - res.send('Lotte VS LG : LG Win!'); 49 + res.writeHead(200,{"Content-Type":"text/html"});
50 + fs.createReadStream("./html/lg_w.html").pipe(res);
39 } 51 }
40 }) 52 })
41 53
42 -app.get('/vs_kia',function(req,res){ 54 +app.get('/vs/kia',function(req,res){
43 if(lotte.v>kia.v){ 55 if(lotte.v>kia.v){
44 - res.send('Lotte VS Kia : Lotte Win!'); 56 + res.writeHead(200,{"Content-Type":"text/html"});
57 + fs.createReadStream("./html/kia_l.html").pipe(res);
45 } 58 }
46 else{ 59 else{
47 - res.send('Lotte VS Kia : Kia Win!'); 60 + res.writeHead(200,{"Content-Type":"text/html"});
61 + fs.createReadStream("./html/kia_w.html").pipe(res);
48 } 62 }
49 }) 63 })
50 64
51 -app.get('/vs_sk',function(req,res){ 65 +app.get('/vs/sk',function(req,res){
52 if(lotte.v>sk.v){ 66 if(lotte.v>sk.v){
53 - res.send('Lotte VS SK : Lotte Win!'); 67 + res.writeHead(200,{"Content-Type":"text/html"});
68 + fs.createReadStream("./html/sk_l.html").pipe(res);
54 } 69 }
55 else{ 70 else{
56 - res.send('Lotte VS SK : SK Win!'); 71 + res.writeHead(200,{"Content-Type":"text/html"});
72 + fs.createReadStream("./html/sk_w.html").pipe(res);
57 } 73 }
58 }) 74 })
59 75
60 -app.get('/vs_hanhwa',function(req,res){ 76 +app.get('/vs/hanhwa',function(req,res){
61 if(lotte.v>hanhwa.v){ 77 if(lotte.v>hanhwa.v){
62 - res.send('Lotte VS Hanhwa : Lotte Win!'); 78 + res.writeHead(200,{"Content-Type":"text/html"});
79 + fs.createReadStream("./html/hanhwa_l.html").pipe(res);
63 } 80 }
64 else{ 81 else{
65 - res.send('Lotte VS Hanhwa : HanHwa Win!'); 82 + res.writeHead(200,{"Content-Type":"text/html"});
83 + fs.createReadStream("./html/hanhwa_w.html").pipe(res);
66 } 84 }
67 }) 85 })
68 86
69 -app.get('/vs_nc',function(req,res){ 87 +app.get('/vs/nc',function(req,res){
70 if(lotte.v>nc.v){ 88 if(lotte.v>nc.v){
71 - res.send('Lotte VS NC : Lotte Win!'); 89 + res.writeHead(200,{"Content-Type":"text/html"});
90 + fs.createReadStream("./html/nc_l.html").pipe(res);
72 } 91 }
73 else{ 92 else{
74 - res.send('Lotte VS NC : NC Win!'); 93 + res.writeHead(200,{"Content-Type":"text/html"});
94 + fs.createReadStream("./html/nc_w.html").pipe(res);
75 } 95 }
76 }) 96 })
77 97
78 -app.get('/vs_doosan',function(req,res){ 98 +app.get('/vs/doosan',function(req,res){
79 if(lotte.v>doosan.v){ 99 if(lotte.v>doosan.v){
80 - res.send('Lotte VS Doosan : Lotte Win!'); 100 + res.writeHead(200,{"Content-Type":"text/html"});
101 + fs.createReadStream("./html/doosan_l.html").pipe(res);
81 } 102 }
82 else{ 103 else{
83 - res.send('Lotte VS Doosan : Doosan Win!'); 104 + res.writeHead(200,{"Content-Type":"text/html"});
105 + fs.createReadStream("./html/doosan_w.html").pipe(res);
84 } 106 }
85 }) 107 })
86 108
87 -app.get('/vs_samsung',function(req,res){ 109 +app.get('/vs/samsung',function(req,res){
88 if(lotte.v>samsung.v){ 110 if(lotte.v>samsung.v){
89 - res.send('Lotte VS Samsung : Lotte Win!'); 111 + res.writeHead(200,{"Content-Type":"text/html"});
112 + fs.createReadStream("./html/samsung_l.html").pipe(res);
90 } 113 }
91 else{ 114 else{
92 - res.send('Lotte VS Samsung : Samsung Win!'); 115 + res.writeHead(200,{"Content-Type":"text/html"});
116 + fs.createReadStream("./html/samsung_w.html").pipe(res);
93 } 117 }
94 }) 118 })
95 119
96 -app.get('/vs_kiwoom',function(req,res){ 120 +app.get('/vs/kiwoom',function(req,res){
97 if(lotte.v>kia.v){ 121 if(lotte.v>kia.v){
98 - res.send('Lotte VS Kiwoom : Lotte Win!'); 122 + res.writeHead(200,{"Content-Type":"text/html"});
123 + fs.createReadStream("./html/kiwoom_l.html").pipe(res);
99 } 124 }
100 else{ 125 else{
101 - res.send('Lotte VS Kiwoom : Kiwoom Win!'); 126 + res.writeHead(200,{"Content-Type":"text/html"});
127 + fs.createReadStream("./html/kiwoom_w.html").pipe(res);
102 } 128 }
103 }) 129 })
104 130
105 -app.get('/vs_kt',function(req,res){ 131 +app.get('/vs/kt',function(req,res){
106 if(lotte.v>kia.v){ 132 if(lotte.v>kia.v){
107 - res.send('Lotte VS KT : Lotte Win!'); 133 + res.writeHead(200,{"Content-Type":"text/html"});
134 + fs.createReadStream("./html/kt_l.html").pipe(res);
108 } 135 }
109 else{ 136 else{
110 - res.send('Lotte VS KT : KT Win!'); 137 + res.writeHead(200,{"Content-Type":"text/html"});
138 + fs.createReadStream("./html/kt_w.html").pipe(res);
111 } 139 }
112 }) 140 })
113 141
......