Skip to content

wadzapi/cpon

Repository files navigation

This is a quickstart for a Vert.x Scala project. It provides a few examples for doing unit-tests.

It comes with vertx-core and vertx-web so you are good to go for a little REST-project. Take your time and take a look.

Scala console

After launching sbt you can switch to the scala-console. There we took care that you get an already initialized Vert.x-instance and the necessary imports to start playing around.

sbt
> console
scala> vertx.deployVerticle(nameForVerticle[me.wadzai.HttpVerticle])
scala> vertx.deploymentIDs

From here you can freely interact with the Vert.x API inside the sbt-scala-shell.

Fat-jar

Take a look at the build.sbt and search for the entry packageOptions. Enter the fully qualified class name of your primary verticle. This will be used as entry point for a generated fat-jar.

To create the runnable fat-jar use:

sbt assembly

Dockerize

The project also contains everything you need to create a Docker-container. Simply run the following command to package your fat-jar inside a Docker-container

sbt docker

To run use

docker run -p 8666:8666 default/vertx-scala

Point your browser to http://127.0.0.1:8666/hello and enjoy :) java -jar target/scala-2.12/vertx-conf-wadzapi-assembly-0.1.0-SNAPSHOT.jar

  Succeeded in deploying verticle

http://localhost:8666/hello world https://vertx.io/blog/scala-is-here/

About

vertx-conf-server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages