Skip to content

Commit

Permalink
🎨 node
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragonet-D committed Jan 30, 2021
1 parent fec6ea9 commit d475872
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ router.get('/', async (ctx, next) => {
});

router.get('/user', async (ctx, next) => {
personModel.findOne({}, (err, docs)=>{
await personModel.findOne({}, (err, docs)=>{
if(!err){
console.log(docs.toJSON())
ctx.status = 200
ctx.response.body = docs.toJSON()
}
})
Expand Down

0 comments on commit d475872

Please sign in to comment.