Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
akira-cn authored Aug 11, 2023
1 parent 99cf883 commit 1d7f33a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ Gone are the days of cumbersome code like this:
// server-side
app.post('/save', async (context) => {
......
await getData(context);
await db.save(data);
const data = await getData(context);
const result = await db.save(data);
context.body = result;
});
```

Expand All @@ -34,9 +35,9 @@ Embrace the future of coding with modular capabilities:
```js
// server-side
...
function save(data) {
async function save(data) {
......
await db.save(data);
return await db.save(data);
}
app.all('/save', modular({save, list, delete}, config.koa));
```
Expand Down

0 comments on commit 1d7f33a

Please sign in to comment.