Get Started

Let's start by building a simple static website in your local environment.

Install Node

Install the latest recommended version of Node.js.

Create Your First Project

Use npm to create a project.

  1. npm init lwr
  2. For Project name, enter StaticSite.
  3. Accept the generated package name by pressing the Enter key.
  4. For Select a type of project, accept the default, Static Site.
  5. For Select a variant, accept the default, Markdown Static Site.

You've created your first project!

The directory structure for the project looks like this:

The scaffolding for the static site contains a website layout using the Nunjucks templating language. It also contains markdown in the content folder for home and about pages.

The lwr.config.json file contains routes to navigate between these pages.

Now, run these commands to see the site on your localhost:

View the site in your browser on your localhost.

Static Site output

Deploying the Static Site to Heroku

Now that we have our static site up and running, deploying to Heroku is a breeze. Heroku uses the preset start script in your project's package.json file, and LWR serves the app on Heroku in the same way as it does locally.

More to Come

We hope that this static site gives you a glimpse of the simplicity and flexibility of LWR. Soon we’ll provide full details on how to leverage the flexibility of LWR to build web apps, blogs, as well as deployment to different hosting environments. We’re just getting started and are excited that you’ll be on this journey with us.

Contact Us

We love to hear your comments or questions! Use the LWR on Node Trailblazer community topic to raise your questions.