1.Lagom 中文意思是恰到好处的意思
2.它是lightbend体系下的微服务架构
例子
1.在 cmd 命令行中输入,一直按enter
sbt new https://github.com/lagom/lagom-scala.g8
2.在当前目录下会创建hello的工程
3.进入该工程 cd hello
4.先 输入sbt ,等编译完后,再输入runAll命令
输出结果为:
[info] Starting embedded Cassandra server
..........
[info] Cassandra server running at 127.0.0.1:4000
[info] Service locator is running at http://localhost:9008
[info] Service gateway is running at http://localhost:9000
[info] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:24266
[info] Service hello-stream-impl listening for HTTP on 0:0:0:0:0:0:0:0:26230
(Services started, press enter to stop and go back to the console...)
可以在浏览器里http://localhost:9000/api/hello/World 查看 Hello, World!
也可以把例子hello导入idea里
如果本地4000端口被占用则在sbt里加上则Cassandra的端口改为9042
lagomCassandraPort in ThisBuild := 9042
这样再http://localhost:9000/api/hello/World 查看有 Hello, World!