This repository was archived by the owner on May 10, 2021. It is now read-only.
This repository was archived by the owner on May 10, 2021. It is now read-only.
Allow API routes to optionally run as background function #166
Closed
Description
Is your feature request related to a problem? Please describe.
Some API routes we build start out nice and simple.
As we complete integrations with 3rd party systems (SAP for example), the tasks these need to perform can unexpectedly grow in complexity. Especially where client-side systems already exist to handle functionality and a client decides not to streamline or rebuild slow-running BAU systems.
Describe the solution you'd like
It would be simple to be able to define a Next API route that we discover needs to run for more than 10 seconds to run as a background function.
Describe alternatives you've considered
- Fork this package.
- Work completely outside Next.js -- creating a custom serverless function that resides as a separate piece of work. Write this in my own time because I enjoy creating simple side-projects.
Additional context
- Most of our serverless code is deployed as API routes built by next-on-netlify, having a single background function implemented outside next-on-netlify creates an unfamiliar pipeline that complicates the onboarding process.
- I've created a version of this package that allows an API route to include the string
-background
to keep all our API routes in a common build step.