Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Run the site locally

Brian Clozel edited this page Jan 7, 2021 · 24 revisions

Goal

Run the Sagan site application locally, so that it can be browsed at http://localhost:8080.

Prerequisites

Steps

Run the site locally from your IDE

Create a new run configuration with the class sagan.SiteApplication. It might help to run ./gradlew build from the top level directory first, in case your IDE doesn't know how to build all the dependencies. In IntelliJ you also might need to configure the launcher to run within the module working directory (i.e. from sagan-site).

Then use this run configuration to start the site!

Note: Sagan is using Spring Boot's developer tools features, such as LiveReload.

Run the site locally from the command line

From the root directory of your sagan repository, run the following:

Tip: New to Gradle? Check out Gradle tips!

SPRING_PROFILES_ACTIVE=standalone ./gradlew :sagan-site:bootRun

After a few seconds, you should see:

sagan.SiteApplication : Started SiteApplication

Now, go to http://localhost:8080 and you should see homepage. Click around and explore a bit—you should find the site is identical in every way to what you see at spring.io.

Note: The exceptions to the above are rendering guides and blogs. Out of the gate, you'll get 500 errors when you try to list the guides and blogs will also fail to compile. To remedy this, you'll need to run the renderer service.

Next steps

At this point, you may want to build everything or import into IDEA or Spring Tools Suite if you have not already.