(timeoutMs)
| 51 | const commonMiddleware = (handler) => { |
| 52 | // Create a timeout promise, to throw an error if a request takes too long |
| 53 | const createTimeoutPromise = (timeoutMs) => { |
| 54 | return new Promise((_, reject) => { |
| 55 | setTimeout(() => { |
| 56 | reject(new Error(`Request timed-out after ${timeoutMs} ms`)); |
| 57 | }, timeoutMs); |
| 58 | }); |
| 59 | }; |
| 60 | |
| 61 | // Vercel |
| 62 | const vercelHandler = async (request, response) => { |
no outgoing calls
no test coverage detected