Showing
64 changed files
with
8 additions
and
2 deletions
... | @@ -4,6 +4,7 @@ var bodyParser = require('body-parser'); | ... | @@ -4,6 +4,7 @@ var bodyParser = require('body-parser'); |
4 | var fs = require("fs"); | 4 | var fs = require("fs"); |
5 | 5 | ||
6 | app.use(express.static('public')); | 6 | app.use(express.static('public')); |
7 | +app.use('/images', express.static(__dirname + '/images')); | ||
7 | app.use(bodyParser.json()); | 8 | app.use(bodyParser.json()); |
8 | app.use(bodyParser.text()); | 9 | app.use(bodyParser.text()); |
9 | app.use(bodyParser.urlencoded({ | 10 | app.use(bodyParser.urlencoded({ |
... | @@ -106,11 +107,15 @@ app.post('/food/recommendation', function(req, res) { | ... | @@ -106,11 +107,15 @@ app.post('/food/recommendation', function(req, res) { |
106 | console.log('food 갯수: '+length); | 107 | console.log('food 갯수: '+length); |
107 | var rand = Math.floor(Math.random() * length); //(Math.random() * (max - min)) + min | 108 | var rand = Math.floor(Math.random() * length); //(Math.random() * (max - min)) + min |
108 | var food_value = food[rand]; | 109 | var food_value = food[rand]; |
110 | + var food_picture = '/images/' + food_value + ".png"; | ||
111 | + | ||
112 | + | ||
109 | console.log('랜덤 food 번호: '+rand); | 113 | console.log('랜덤 food 번호: '+rand); |
110 | res.render('print.ejs', { | 114 | res.render('print.ejs', { |
111 | title: 'Recommendation', | 115 | title: 'Recommendation', |
112 | description: 'We recommend this...', | 116 | description: 'We recommend this...', |
113 | - randvalue: food_value | 117 | + randvalue: food_value, |
118 | + picture : food_picture | ||
114 | }); //rander closed | 119 | }); //rander closed |
115 | }); //add closed | 120 | }); //add closed |
116 | } | 121 | } | ... | ... |
images/간짜장.png
0 → 100644
14.1 KB
images/갈비탕.png
0 → 100644
11.3 KB
images/곰탕.png
0 → 100644
6.66 KB
images/굴국밥.png
0 → 100644
8.9 KB
images/김밥.png
0 → 100644
10.7 KB
images/김치볶음밥.png
0 → 100644
9.94 KB
images/김치찌개.png
0 → 100644
9.58 KB
images/깐쇼새우.png
0 → 100644
9.88 KB
images/깐풍기.png
0 → 100644
13.3 KB
images/난자완스.png
0 → 100644
11 KB
images/내장탕.png
0 → 100644
8.59 KB
images/냉면.png
0 → 100644
6.37 KB
images/돈까스.png
0 → 100644
11.6 KB
images/돼지국밥.png
0 → 100644
9.78 KB
images/된장찌개.png
0 → 100644
12 KB
images/떡볶이.png
0 → 100644
8.18 KB
images/라멘.png
0 → 100644
9.17 KB
images/라면.png
0 → 100644
8.67 KB
images/만두.png
0 → 100644
6.49 KB
images/보쌈.png
0 → 100644
12 KB
images/볶음밥.png
0 → 100644
11.7 KB
images/부대찌개.png
0 → 100644
16.2 KB
images/빵.png
0 → 100644
11.6 KB
images/뼈다귀해장국.png
0 → 100644
10.5 KB
images/삼겹살.png
0 → 100644
10.3 KB
images/삼계탕.png
0 → 100644
9.84 KB
images/새우볶음밥.png
0 → 100644
10.1 KB
images/샌드위치.png
0 → 100644
9.84 KB
images/생선구이.png
0 → 100644
9.27 KB
images/소고기.png
0 → 100644
10.2 KB
images/소고기덮밥.png
0 → 100644
9.6 KB
images/순대.png
0 → 100644
13.7 KB
images/순대국밥.png
0 → 100644
7.74 KB
images/순두부찌개.png
0 → 100644
9.64 KB
images/스팸마요.png
0 → 100644
11.7 KB
images/오뎅탕.png
0 → 100644
9.35 KB
images/오므라이스.png
0 → 100644
7.22 KB
images/오징어덮밥.png
0 → 100644
11 KB
images/우동.png
0 → 100644
8.9 KB
images/울면.png
0 → 100644
8.84 KB
images/육개장.png
0 → 100644
9.17 KB
images/잔치국수.png
0 → 100644
8.11 KB
images/잡채밥.png
0 → 100644
14.1 KB
images/제육덮밥.png
0 → 100644
8.95 KB
images/족발.png
0 → 100644
13 KB
images/중국냉면.png
0 → 100644
9 KB
images/짜장면.png
0 → 100644
12.4 KB
images/짜장밥.png
0 → 100644
10.7 KB
images/짬뽕.png
0 → 100644
7.35 KB
images/짬뽕밥.png
0 → 100644
7.38 KB
images/참치마요.png
0 → 100644
11.2 KB
images/청국장.png
0 → 100644
8.89 KB
images/초밥.png
0 → 100644
9.58 KB
images/치킨.png
0 → 100644
7.61 KB
images/치킨마요.png
0 → 100644
11.4 KB
images/콩나물국밥.png
0 → 100644
9.85 KB
images/탕수육.png
0 → 100644
11.6 KB
images/파스타.png
0 → 100644
6.08 KB
images/피자.png
0 → 100644
10.8 KB
images/햄버거.png
0 → 100644
10 KB
images/회.png
0 → 100644
10.3 KB
images/회덮밥.png
0 → 100644
11.7 KB
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | + | ||
2 | <html lang="en" dir="ltr"> | 3 | <html lang="en" dir="ltr"> |
3 | 4 | ||
4 | <head> | 5 | <head> |
... | @@ -22,8 +23,8 @@ | ... | @@ -22,8 +23,8 @@ |
22 | </h2> | 23 | </h2> |
23 | <p><%= description %></p> | 24 | <p><%= description %></p> |
24 | <p><%= randvalue%></p> | 25 | <p><%= randvalue%></p> |
26 | + <img src = <%= picture%>> | ||
25 | </article> | 27 | </article> |
26 | </div class="grid"> | 28 | </div class="grid"> |
27 | -</body> | ||
28 | 29 | ||
29 | </html> | 30 | </html> | ... | ... |
-
Please register or login to post a comment