윤희찬

Update router.js, main.html and main.js

1 -<style type='text/css'>
2 - @import url("style.css");
3 - </style>
4 1
5 <!DOCTYPE html> 2 <!DOCTYPE html>
6 <html lang="en"> 3 <html lang="en">
......
...@@ -14,7 +14,7 @@ searchForm.addEventListener('submit', function(event){ ...@@ -14,7 +14,7 @@ searchForm.addEventListener('submit', function(event){
14 }); 14 });
15 15
16 async function fetchAPI(){ 16 async function fetchAPI(){
17 - const recipeURL = `https://api.edamam.com/search?q=${searchQuery}&app_id=${APP_ID}&app_key=${APP_KEY}`; 17 + const recipeURL = `https://api.edamam.com/search?q=pizza&app_id=${APP_ID}&app_key=${APP_KEY}`;
18 const response = await fetch(recipeURL); 18 const response = await fetch(recipeURL);
19 const data = await response.json(); 19 const data = await response.json();
20 boxinfo(data.hits); 20 boxinfo(data.hits);
......
...@@ -25,6 +25,10 @@ router.get('/loginFail', (req, res) => { ...@@ -25,6 +25,10 @@ router.get('/loginFail', (req, res) => {
25 res.render('loginFail') 25 res.render('loginFail')
26 }) 26 })
27 27
28 +//Express에서 정적파일(ex: main.html, main.js)들을 사용할경우
29 +//경로를 미리 제시해 주는 부분
30 +router.use(express.static(__dirname + '/main'));
31 +
28 //메인화면 32 //메인화면
29 router.get('/main', (req, res)=>{ 33 router.get('/main', (req, res)=>{
30 res.sendFile(path.join(__dirname+'/main/main.html')); 34 res.sendFile(path.join(__dirname+'/main/main.html'));
......