craigmulligan / nawr

Serverless SQL databases on demand
9 stars 0 forks source link

Workers #12

Open craigmulligan opened 4 years ago

craigmulligan commented 4 years ago

It'd be rad if you could add files to /workers directory and then call them from your next.js app:

// workers/sendEmail.js
export default (ctx) => {
   // send email logic.
}
// anywhere in app
import worker from 'nawr/worker'
...
await worker.start('sendEmail', ctx)