Toggle navigation
Toggle navigation
This project
Loading...
Sign in
구희연
/
Food_recipe_info
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
윤희찬
2021-11-23 11:57:07 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
293e36b1a33ad33a26e91e43803acaeb04a89440
293e36b1
1 parent
479c1b41
Update router.js, main.html and main.js
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
main/main.html
main/main.js
router.js
main/main.html
View file @
293e36b
<style
type=
'text/css'
>
@import
url("style.css")
;
</style>
<!DOCTYPE html>
<html
lang=
"en"
>
...
...
main/main.js
View file @
293e36b
...
...
@@ -14,7 +14,7 @@ searchForm.addEventListener('submit', function(event){
});
async
function
fetchAPI
(){
const
recipeURL
=
`https://api.edamam.com/search?q=
${
searchQuery
}
&app_id=
${
APP_ID
}
&app_key=
${
APP_KEY
}
`
;
const
recipeURL
=
`https://api.edamam.com/search?q=
pizza
&app_id=
${
APP_ID
}
&app_key=
${
APP_KEY
}
`
;
const
response
=
await
fetch
(
recipeURL
);
const
data
=
await
response
.
json
();
boxinfo
(
data
.
hits
);
...
...
router.js
View file @
293e36b
...
...
@@ -25,6 +25,10 @@ router.get('/loginFail', (req, res) => {
res
.
render
(
'loginFail'
)
})
//Express에서 정적파일(ex: main.html, main.js)들을 사용할경우
//경로를 미리 제시해 주는 부분
router
.
use
(
express
.
static
(
__dirname
+
'/main'
));
//메인화면
router
.
get
(
'/main'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
path
.
join
(
__dirname
+
'/main/main.html'
));
...
...
Please
register
or
login
to post a comment