Skip to content

Commit

Permalink
Create vin-decode.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanclevenger authored Aug 23, 2023
1 parent a61dc9e commit d4ebac9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/vin-decode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { QueueConsumer } from 'kafka.do'

export default QueueConsumer({
async queue(batch, env, ctx) {
for (const message of batch.messages) {
const { vin, nextQueue } = message
// TODO: get this `decodeVIN` method implemented
const { squishVIN, year, make, model, trim, style } = await decodeVIN(vin)
env[nextQueue].send({ vin, squishVIN, year, make, model, trim, style })
}
},
})

0 comments on commit d4ebac9

Please sign in to comment.