overleaf/services/chat/test/acceptance/coffee/helpers/ChatClient.coffee
2016-12-14 17:38:14 +00:00

16 lines
No EOL
396 B
CoffeeScript

request = require("request").defaults({baseUrl: "http://localhost:3010"})
module.exports =
sendMessage: (project_id, user_id, content, callback) ->
request.post {
url: "/room/#{project_id}/messages"
json:
user_id: user_id
content: content
}, callback
getMessages: (project_id, callback) ->
request.get {
url: "/room/#{project_id}/messages",
json: true
}, callback