Seed project for akka http back-end with angular front-end (currently Angular 5) and configured for heroku
This project is a starting point to build a full-stack web application using Scala / Akka Http as the backend and Angular 5 as the front-end. It is configured in such a way as to allow for deployment to Heroku in a single dyno by following the steps below.
Follow these steps to get started:
-
Git-clone this repository.
git clone git://github.com/jdschmitt/spray-angular-heroku.git my-project
-
Change directory into your clone:
cd my-project
-
Start the application:
sbt compile run
-
Browse to http://localhost:8080
-
Start hacking on
src/main/scala/com/example/MyService.scala
for new APIs -
Start hacking in
client
folder for Angular app
-
heroku create my-project
-
heroku buildpacks:set heroku/nodejs
-
heroku buildpacks:add heroku/scala
-
git push heroku master
-
heroku open
Note: The order you add the buildpacks is important. NodeJS buildpack must be added first.
- See Angular CLI docs for adding more components etc.
- If you update the name in build.sbt then you must also update the file name of the target in Procfile to match
- build.sbt adds a dependency to the Compile task which is responsible for building the Angular application.
- Basic Specs2 tests included. Execute with
sbt test
- For Spray with Angular 2 front-end, check the spray-angular2 branch.
- For Spray with Angular 4 front-end, check the spray-angular4 branch.