kelley robinson

Hello Finatra - An Introduction to Giter8 Templates

July 17, 2018

Giter8 templates are an amazing tool for spinning up new Scala projects quickly. I recently created a template for a lightweight Finatra API.

Check out the template on my GitHub: https://github.com/robinske/hello-finatra.g8

Giter8 Templates

Giter8 is a command line tool to generate files and directories from templates published on Github or any other git repository. It’s implemented in Scala and runs through the sbt launcher, but it can produce output for any purpose.

You can learn more about how to create your own templates in their documentation.

Using the Hello Finatra template

Requirements:

In a terminal window type:

sbt new robinske/hello-finatra.g8

You can name your project anything you like, but avoid using numbers or dashes.

image

Running ‘Hello World’

Navigate into your directory, in my case:

cd finatra_demo

Then run using SBT:

sbt run

Finatra will start on port 8888.

Hooray!

Next Steps

I originally built this so that I could have a way to respond to incoming SMS messages with Twilio and Scala. Check out that post on the Twilio blog if you want to build on this example.


© 2024