We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Please describe.
currently the request handler takes all routes * I'm just running a slack bot.
*
// route for webhook request server.all('*', (req, res) => { return handle(req, res); });
I want to also serve a react app on the same express/ setup because of the way client side routes work it's also best to use a * for serving these.
https://create-react-app.dev/docs/deployment/#serving-apps-with-client-side-routing
so the solution I think is to just pass specific named routes to bottender:
server.all('/webhooks/slack', (req, res) => { return handle(req, res); });
I think this works ok... but I'm not sure if handle() is expecting the route to be named, or if it defines the route itself assuming it's mounted at /
handle()
/
Describe the solution you'd like A bit more info on combining botTender express and other tools would be helpful.
Describe alternatives you've considered nginx reverse proxies. But I hit other problems there :(
The text was updated successfully, but these errors were encountered:
You could use /webhooks/* instead:
/webhooks/*
server.all('/webhooks/*', (req, res) => { return handle(req, res); }); server.get('/*', function (req, res) { res.sendFile(path.join(__dirname, 'build', 'index.html')); });
And you must make sure all of your path in your bottender.config.js file starts with /webhooks to keep it working:
path
bottender.config.js
/webhooks
channels: { slack: { enabled: ${platforms.includes('slack')}, path: '/webhooks/slack', accessToken: process.env.SLACK_ACCESS_TOKEN, signingSecret: process.env.SLACK_SIGNING_SECRET, }, },
Sorry, something went wrong.
@dcsan Does this approach work in your case?
No branches or pull requests
Is your feature request related to a problem? Please describe.
currently the request handler takes all routes
*
I'm just running a slack bot.
I want to also serve a react app on the same express/ setup
because of the way client side routes work it's also best to use a
*
for serving these.https://create-react-app.dev/docs/deployment/#serving-apps-with-client-side-routing
so the solution I think is to just pass specific named routes to bottender:
I think this works ok... but I'm not sure if
handle()
is expecting the route to be named, or if it defines the route itself assuming it's mounted at/
Describe the solution you'd like
A bit more info on combining botTender express and other tools would be helpful.
Describe alternatives you've considered
nginx reverse proxies. But I hit other problems there :(
The text was updated successfully, but these errors were encountered: