이승규

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

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