이승규

사망요인리스트에 요인이 하나만 들어있을 때 오류해결

...@@ -22,10 +22,10 @@ app.use(express.urlencoded({ extended: false })); ...@@ -22,10 +22,10 @@ app.use(express.urlencoded({ extended: false }));
22 app.use(cookieParser()); 22 app.use(cookieParser());
23 app.use('/',express.static(path.join(__dirname, 'public'))); 23 app.use('/',express.static(path.join(__dirname, 'public')));
24 app.use('/',express.static(path.join(__dirname, 'code'))); 24 app.use('/',express.static(path.join(__dirname, 'code')));
25 -app.use('/Cname/:Cname/Cbirth',express.static(path.join(__dirname, 'public'))); 25 +app.use('/Cname/:name/Cbirth',express.static(path.join(__dirname, 'public')));
26 -app.use('/Cname/:Cname/Cbirth',express.static(path.join(__dirname, 'code'))); 26 +app.use('/Cname/:name/Cbirth',express.static(path.join(__dirname, 'code')));
27 -app.use('/Fname/:Fname/Fbirth',express.static(path.join(__dirname, 'newpublic'))); 27 +app.use('/Fname/:name/Fbirth',express.static(path.join(__dirname, 'newpublic')));
28 -app.use('/Fname/:Fname/Fbirth',express.static(path.join(__dirname, 'newcode'))); 28 +app.use('/Fname/:name/Fbirth',express.static(path.join(__dirname, 'newcode')));
29 29
30 30
31 app.use('/', indexRouter); 31 app.use('/', indexRouter);
......
...@@ -162,7 +162,7 @@ module.exports = (server, app) => { ...@@ -162,7 +162,7 @@ module.exports = (server, app) => {
162 //죽을 확률 계산(내맘대로 커스텀) 162 //죽을 확률 계산(내맘대로 커스텀)
163 info.death_prob = ( 163 info.death_prob = (
164 (info.heat / 50) + (Math.abs(info.sensible_temperature - 15) / 10) + (info.discomport / 10) + (info.UV / 10) 164 (info.heat / 50) + (Math.abs(info.sensible_temperature - 15) / 10) + (info.discomport / 10) + (info.UV / 10)
165 - + info.windspd*1 + (info.rain / 10) + (Math.abs(info.current_temperature - 15) / 10) 165 + + info.windspd*1 + (info.rain / 10) + (Math.abs(info.current_temperature - 15) / 10) + (info.traffic / 5)
166 ); 166 );
167 167
168 // ------------------------------ death_factor 정의 ------------------------------ 168 // ------------------------------ death_factor 정의 ------------------------------
...@@ -182,7 +182,7 @@ module.exports = (server, app) => { ...@@ -182,7 +182,7 @@ module.exports = (server, app) => {
182 182
183 Death_Factors.push("심장마비로 사망"); //반드시 하나의 요인은 추가되어야 함 183 Death_Factors.push("심장마비로 사망"); //반드시 하나의 요인은 추가되어야 함
184 184
185 - info.death_factor = Death_Factors[Math.round(Math.random()*Death_Factors.length)]; //사망요인 하나를 렌덤으로 고른다. 185 + info.death_factor = Death_Factors[Math.floor(Math.random()*Death_Factors.length)]; //사망요인 하나를 렌덤으로 고른다.
186 186
187 187
188 //이벤트 기반으로 일정 시간 간격으로 클라이언트에게 보낼 정보 188 //이벤트 기반으로 일정 시간 간격으로 클라이언트에게 보낼 정보
......
...@@ -12,7 +12,7 @@ router.post('/forecasting' , (req,res) =>{ ...@@ -12,7 +12,7 @@ router.post('/forecasting' , (req,res) =>{
12 res.redirect(`/Fname/${req.body.name}/Fbirth/${req.body.birth}`); 12 res.redirect(`/Fname/${req.body.name}/Fbirth/${req.body.birth}`);
13 }) 13 })
14 14
15 -router.get('/Fname/:Fname/Fbirth/:Fbirth',(req,res)=>{ 15 +router.get('/Fname/:name/Fbirth/:birth',(req,res)=>{
16 16
17 // 렌더링 변수 17 // 렌더링 변수
18 var time = new Array(); // 타임스탬프 18 var time = new Array(); // 타임스탬프
...@@ -73,7 +73,7 @@ router.get('/Fname/:Fname/Fbirth/:Fbirth',(req,res)=>{ ...@@ -73,7 +73,7 @@ router.get('/Fname/:Fname/Fbirth/:Fbirth',(req,res)=>{
73 }); 73 });
74 } ) 74 } )
75 75
76 -router.get('/Cname/:Cname/Cbirth/:Cbirth', (req,res) => { 76 +router.get('/Cname/:name/Cbirth/:birth', (req,res) => {
77 77
78 // 렌더링 변수 78 // 렌더링 변수
79 var time = new Array(); // 타임스탬프 79 var time = new Array(); // 타임스탬프
......