김대선

데이털 읽는 함수 오류 수정

...@@ -19,6 +19,6 @@ const server = app.listen(3000,()=>{ ...@@ -19,6 +19,6 @@ const server = app.listen(3000,()=>{
19 19
20 app.get('/', async (req, res)=>{ 20 app.get('/', async (req, res)=>{
21 21
22 - 22 + data = await dataFunctions.read()
23 - res.send("hello world") 23 + res.send(data)
24 }) 24 })
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -19,10 +19,10 @@ const read = async () =>{ ...@@ -19,10 +19,10 @@ const read = async () =>{
19 tags = stringArray[i].replace("tags : ", "").split(",") 19 tags = stringArray[i].replace("tags : ", "").split(",")
20 } 20 }
21 else if( i % 4 == 2){ 21 else if( i % 4 == 2){
22 - tags = stringArray[i].replace("url : ", "") 22 + url = stringArray[i].replace("url : ", "")
23 } 23 }
24 else if ( i % 4 == 3){ 24 else if ( i % 4 == 3){
25 - companyName = stringArray[i].replace("company : ", "") 25 + companyName = stringArray[i].replace("companyName : ", "")
26 data.push({ 26 data.push({
27 title : title, 27 title : title,
28 tags : tags, 28 tags : tags,
...@@ -31,7 +31,7 @@ const read = async () =>{ ...@@ -31,7 +31,7 @@ const read = async () =>{
31 }) 31 })
32 } 32 }
33 } 33 }
34 - console.log(data) 34 + return data
35 } 35 }
36 36
37 const save = async()=> { 37 const save = async()=> {
......