Seed project for spray back-end with angular front-end (currently Angular 4) and configured for heroku
This project is a starting point to build a full-stack web application using Scala / Spray as the backend and Angular 2 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-angular2-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 Angular 2 front-end, check the angular2 branch.