GithubHelp home page GithubHelp logo

Comments (4)

poweld avatar poweld commented on September 9, 2024 1

This sounds like a good addition. I can't promise to review it until the weekend, so take your time with the PR. It looks like you're on a good track in your proof of concept.

from hipchat-scala.

pedrorijo91 avatar pedrorijo91 commented on September 9, 2024

It is possible (and easy) to override the default api-url by adding the config to an application.conf file as stated at https://www.playframework.com/documentation/2.4.x/ProductionConfiguration#General-configuration

unfortunately this is not practical if we want to have "clients" for different instances in the same application.

I could do a PR which would allow to pass a base url explicitly, for instance something like:

class RoomNotifier(private[this] val apiToken: String, baseUrlOpt: Option[String] = None)(implicit executor: ExecutionContext) extends Logging {

  (...)

}

object RoomNotifier {
  val instanceUrl = baseUrlOpt.map(Common.url)
  private def url(roomIdOrName: String) = (instanceUrl.getOrElse(apiUrl) / "room" / roomIdOrName / "notification").POST
}

Let me know your thoughts about this

from hipchat-scala.

pedrorijo91 avatar pedrorijo91 commented on September 9, 2024

Proof of Concept here: master...pedrorijo91:feature/customApiURL

Still need to test it, and there are probably some minor improvements to be done, and maybe other code style issues you'd prefer different. I will have a better look at my code tomorrow before doing a PR. In the meanwhile let me know if you find something you disagree :)

from hipchat-scala.

pedrorijo91 avatar pedrorijo91 commented on September 9, 2024

thanks for the heads up @poweld. I did the PR #23 this morning, let me know your thoughts when you find the time :)

from hipchat-scala.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.