mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-13 23:22:30 +00:00
Use internal url for chat
This commit is contained in:
parent
8d946e68d2
commit
e0f1ed3c10
3 changed files with 7 additions and 6 deletions
|
@ -10,7 +10,7 @@ module.exports =
|
|||
json:
|
||||
content:messageContent
|
||||
user_id:user_id
|
||||
uri:"#{settings.apis.chat.url}/room/#{project_id}/messages"
|
||||
uri:"#{settings.apis.chat.internal_url}/room/#{project_id}/messages"
|
||||
request opts, (err, response, body)->
|
||||
if err?
|
||||
logger.err err:err, "problem sending new message to chat"
|
||||
|
@ -24,7 +24,7 @@ module.exports =
|
|||
qs.before = query.before if query?.before?
|
||||
|
||||
opts =
|
||||
uri:"#{settings.apis.chat.url}/room/#{project_id}/messages"
|
||||
uri:"#{settings.apis.chat.internal_url}/room/#{project_id}/messages"
|
||||
method:"get"
|
||||
qs: qs
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ module.exports =
|
|||
subdomain: ""
|
||||
chat:
|
||||
url: "http://localhost:3010"
|
||||
internal_url: "http://localhost:3010"
|
||||
templates:
|
||||
port: 3007
|
||||
user_id: process.env.TEMPLATES_USER_ID or "5395eb7aad1f29a88756c7f2"
|
||||
|
|
|
@ -13,7 +13,7 @@ describe "ChatHandler", ->
|
|||
@settings =
|
||||
apis:
|
||||
chat:
|
||||
url:"chat.sharelatex.env"
|
||||
internal_url:"chat.sharelatex.env"
|
||||
@request = sinon.stub()
|
||||
@ChatHandler = SandboxedModule.require modulePath, requires:
|
||||
"settings-sharelatex":@settings
|
||||
|
@ -38,7 +38,7 @@ describe "ChatHandler", ->
|
|||
json:
|
||||
content:@messageContent
|
||||
user_id:@user_id
|
||||
uri:"#{@settings.apis.chat.url}/room/#{@project_id}/messages"
|
||||
uri:"#{@settings.apis.chat.internal_url}/room/#{@project_id}/messages"
|
||||
@request.calledWith(@opts).should.equal true
|
||||
done()
|
||||
|
||||
|
@ -59,7 +59,7 @@ describe "ChatHandler", ->
|
|||
@ChatHandler.getMessages @project_id, @query, (err)=>
|
||||
@opts =
|
||||
method:"get"
|
||||
uri:"#{@settings.apis.chat.url}/room/#{@project_id}/messages"
|
||||
uri:"#{@settings.apis.chat.internal_url}/room/#{@project_id}/messages"
|
||||
qs:{}
|
||||
@request.calledWith(@opts).should.equal true
|
||||
done()
|
||||
|
@ -70,7 +70,7 @@ describe "ChatHandler", ->
|
|||
@ChatHandler.getMessages @project_id, @query, (err)=>
|
||||
@opts =
|
||||
method:"get"
|
||||
uri:"#{@settings.apis.chat.url}/room/#{@project_id}/messages"
|
||||
uri:"#{@settings.apis.chat.internal_url}/room/#{@project_id}/messages"
|
||||
qs:
|
||||
limit:5
|
||||
before:12345
|
||||
|
|
Loading…
Reference in a new issue