Feel free to check out the documentation[2] if you're interested in setting up a very simple REST server with Spring Boot.
- [1] - https://github.com/DWiechert/spring-boot
- [2] - https://github.com/DWiechert/spring-boot/blob/master/README.md
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.8.0")
After that was added, I had to add the following to my build.sbt file: import NativePackagerKeys._
packageArchetype.java_application
Heroku utilizes this native packager and foreman to run Scala applications which is not something I was doing when I would run it locally. val dbUri = new URI(System.getenv("DATABASE_URL"))
val username = dbUri.getUserInfo.split(":")(0)
val password = dbUri.getUserInfo.split(":")(1)
val db = Database.forURL(s"jdbc:postgresql://${dbUri.getHost}:${dbUri.getPort}${dbUri.getPath}", driver = "org.postgresql.Driver", user = username, password = password)
This connection setup uses slick, where their example just had a regular database connection. heroku config
If you have the database add-on installed, it will spit out a database url that we need. We just need to know how to decipher this long url and break it into the individual parts: DATABASE_URL: postgres://user:password@server:port/database
Once we know how the url is broken down (example above), you just plug each part into pgadmin (like the SO answer says) and you can see your data on your local install of pgadmin. val myPort = Properties.envOrElse("PORT", "8080").toInt // for Heroku compatibility
IO(Http) ? Http.Bind(service, interface = "0.0.0.0", port = myPort)
This allows my app to get the proper port from Heroku or use a default of 8080 if I'm running locally. sudo modprobe w1-gpio
sudo modprobe w1-therm
/sys/bus/w1/devices/w1_bus_master1/<serial id>/w1_slave
4d 01 4b 46 7f ff 03 10 d8 : crc=d8 YES
4d 01 4b 46 7f ff 03 10 d8 t=20812
/sensors/list
/alerts/list
/alerts/setOn/<name>
/alerts/setOff/<name>
/alerts/update/<name>
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")
To the file: ~/.sbt/0.13/plugins/plugins.sbt
C:\Users\Dan\.sbt\0.13\plugins\plugins.sbt
sbt eclipse
C:\Users\Dan\.ivy2\cache
However, I did not want my downloaded jars to reside there because that meant each user would have their own copies of all of the scala jars used. So, I found yet another SO answer that showed me how to change the download location. I simply had to edit my sbtconfig.txt file, which was located at - C:\Program Files (x86)\sbt\conf\sbtconfig.txt - and had to add the following 2 lines: -Dsbt.ivy.home=S:\SBTRepo
-Divy.home=S:\SBTRepo
So now all jars will download to the folder - S:\SBTRepo - for all users and not to each user's individual local files.