Skip to content

Commit

Permalink
Merge pull request #47 from grammyjs/46-next-node-webhook-example-fai…
Browse files Browse the repository at this point in the history
…ls-in-vercel-production-environment

Next.js example fix
  • Loading branch information
KnorpelSenf authored Mar 17, 2024
2 parents 52dfa04 + 8660bb3 commit 0b13451
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setups/next-node/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @ts-check

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ['grammy'],
},
}

export default nextConfig
5 changes: 5 additions & 0 deletions setups/next-node/pages/api/webhook.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { bot } from '../../src/bot'
import { webhookCallback } from 'grammy'

// webhookCallback will make sure that the correct middleware(listener) function is called
export default webhookCallback(bot, 'next-js')

0 comments on commit 0b13451

Please sign in to comment.