Help for creating a function to improve the use of async functions #103
Unanswered
rodrigooler
asked this question in
Q&A
Replies: 1 comment
-
I solved the problem as follows, I threw in the sendAsync onAborted function. I believe you can solve it for an hour, but I would like to try to resolve this in a better way. const { fearless, get, post, send, sendAsync } = require('./src')
const axios = require('axios')
const test = async () => {
const { data } = await axios.get(
'https://jsonplaceholder.typicode.com/todos/1'
)
return data
}
fearless([
get('/', (req, res) => {
send(200, ['123', '456', 678], res)
}),
post('/user', (req, res) => {
sendAsync(200, test, res)
})
]) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I would like help to create a resource in my framework that is using uWS in the core, which would be this here:
https://github.com/fearlessjs/fearless
I am improving the use of async functions to avoid encoding anything other than the proposed framework in the case in this scenario.
But I want to prevent the developer from having to worry about x, for example:
I am open to ideas and questions, I am currently using this simple layer abstraction to become more productive on a day to day basis with the use of uWS
Beta Was this translation helpful? Give feedback.
All reactions