I want to develop a new realtime-api
For example
- Create a file in
/packages/rocketchat-lib/server/functions
, name it asgetMessageHistory.js
, the content is as same asloadMessageHistory.js
, of course, i will replaceloadMessageHistory
togetMessageHistory
- Create a file in
/packages/rocketchat-lib/server/methods
, name it asgetHistory.js
, write some code , register methods
Meteor.methods({
getHistory () {....}
})
- In
/packages/rocketchat-lib/package.js
, add
api.addFiles('server/functions/getMessageHistory.js', 'server');
api.addFiles('server/methods/getHistory.js', 'server');
- call the method
getHistory
{
id: ""
method: "getHistory"
msg: "method"
params: ["E9TJgqz3B9C8xZRsgpFKb842Pfq8cwZyuE", 1543248000000, 1543334399000]
}
At last , i get the response:
{
error: {
error: 404
errorType: "Meteor.Error"
isClientSafe: true
message: "Method 'getHistory' not found [404]"
reason: "Method 'getHistory' not found"
},
id: ""
msg: "result"
}
It must something wrong, but i don’t know, can somebody tell me ? thanks