Replies: 2 comments 3 replies
|
不好意思,这两天有点忙,才看到。你具体遇到的问题是什么? |
2 replies
|
试了一下,不要用 const { OfficialAccount, ServerRequest } = require('node-easywechat');
const HyperExpress = require('hyper-express');
const app = new OfficialAccount({
app_id: '',
secret: '',
token: '',
aes_key: '',
});
const webserver = new HyperExpress.Server();
webserver.any('/server', async (req, resp) => {
const body = await req.text();
const request = new ServerRequest(
req.method,
req.url,
req.headers,
body,
'1.1',
req.query_parameters
);
app.setRequest(request);
const server = app.getServer();
server.with(async (message) => {
console.log('message', message);
});
const response = await server.serve();
resp.send(response.getBody());
})
// Activate webserver by calling .listen(port, callback);
webserver.listen(6000)
.then((socket) => console.log('Webserver started on port 6000'))
.catch((error) => console.log('Failed to start webserver on port 6000')); |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
没能搞定,作者能看看怎么解决吗?https://gitee.com/UCT/uctoo-backend/blob/master/src/app/controllers/wechatopen_applet/index.ts
All reactions