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
i want to run the line-notify and line-bot routing services at the same time and same port, like this:
const bodyParser = require('body-parser'); const express = require('express'); const { bottender } = require('bottender'); // const { createServer } = require('bottender/express'); const app = bottender({ dev: process.env.NODE_ENV !== 'production', }); const handle = app.getRequestHandler(); app.prepare().then(() => { const server = express(); const verify = (req, _, buf) => { req.rawBody = buf.toString(); }; server.use(bodyParser.json({ verify })); server.use(bodyParser.urlencoded({ extended: false, verify })); server.use('/notify', require('./routes/line-notify')); // some bot route in here... server.get('/hello', (req, res) => { res.json({ hello: "world" }); }); server.all('*', (req, res) => { return handle(req, res); }); const port = Number(process.env.PORT) || 5001; server.listen(port, err => { if (err) throw err; console.log(`> Ready on http://localhost:${port}`); }); });
so I followed the following article for migration: https://bottender.js.org/docs/zh-TW/advanced-guides-custom-server
but my project cannot execute src/index.js when let bottender start to node server.js in package.json, so i can't get context!
src/index.js
bottender start
node server.js
package.json
i also refer to other articles: https://blog.techbridge.cc/2018/05/10/lets-build-weather-bot-1/
but when I require('Bottender/express'), i get Error: Cannot find module'Bottender/express'. is it deprecated?
require('Bottender/express')
Error: Cannot find module'Bottender/express'
how can i do? how to get the context after migration? Thanks a lot for any ideas.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i want to run the line-notify and line-bot routing services at the same time and same port, like this:
so I followed the following article for migration:
https://bottender.js.org/docs/zh-TW/advanced-guides-custom-server
but my project cannot execute
src/index.js
when letbottender start
tonode server.js
inpackage.json
, so i can't get context!i also refer to other articles:
https://blog.techbridge.cc/2018/05/10/lets-build-weather-bot-1/
but when I
require('Bottender/express')
, i getError: Cannot find module'Bottender/express'
. is it deprecated?how can i do? how to get the context after migration?
Thanks a lot for any ideas.
The text was updated successfully, but these errors were encountered: