Skip to content

Commit

Permalink
[ADMIN] Auto deploy inngest from admin once deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
samtgarson committed Dec 18, 2023
1 parent 870d564 commit f78605e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions admin/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ app.on('error', (err, ctx) => {
})

const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 5001
app.listen(port, () => {
console.log(`> Ready on http://localhost:${port}`)
app.listen(port, async () => {
console.log(`> Ready on port ${port}`)
const res = await fetch('http://localhost:${port}/api/inngest', {
method: 'PUT'
})

if (res.ok) console.log('> Inngest client registered')
else console.error('> Failed to register Inngest client', await res.text())
})

0 comments on commit f78605e

Please sign in to comment.