# sample-node-app **Repository Path**: mirrors_floatdrop/sample-node-app ## Basic Information - **Project Name**: sample-node-app - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-05-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Habitat Sample Node App Welcome to the Habitat Sample Node App! ### Follow the demo instructions For the full experience, check out the [Habitat Demo instructions](https://www.habitat.sh/demo/) on the habitat.sh website. This will walk you through getting setup on the Habitat Builder web app and publishing this sample app to Docker Hub. Alternatively, you can use the instructions below if you simply want to build and run the app locally. ![habitat-sample-node-app](https://user-images.githubusercontent.com/446285/31078915-96033340-a749-11e7-906c-7861521894fc.png) ## Instructions To practice packaging/running this app with Habitat ### Workstation Prerequisites * Install and set up Habitat [(Instructions here)](https://www.habitat.sh/tutorials/download/) * Install Docker [(Instructions here)](https://www.docker.com/community-edition) * Clone this repository ```bash $ git clone https://github.com/habitat-sh/sample-node-app.git ``` * Change directories ```bash $ cd sample-node-app ``` ### Setup for First-time Users Before you can build the app, you'll need to create an origin and accompanying keys. The quickest way to do this is by running `hab setup` and following the prompts. ```bash $ hab setup ``` **Note** - the origin name you enter during setup will need to be added to the plan.sh file mentioned in the next section. ### Building the Package From the `/habitat` directory in this repo, open the habitat/plan.sh file: Your habitat/plan.sh should look like this: ```sh pkg_name=sample-node-app pkg_origin=your_origin pkg_scaffolding="core/scaffolding-node" ``` First, change the value of `your_origin` to the origin name your created in the previous section. If you're following the [demo instructions](https://www.habitat.sh/demo/), then use the origin name you created in the Builder web app. Next, let's add in a version number ```sh pkg_name=sample-node-app pkg_origin=your_origin pkg_scaffolding="core/scaffolding-node" pkg_version="1.0.1" ``` Now save and close the file. Enter the Habitat Studio ```bash $ hab studio enter ``` And run build ```bash (studio) $ build ``` ### Running the Package with Docker Still in your studio, right after the build, export that package to a docker image ```bash (studio) $ hab pkg export docker ./results/.hart ``` Then exit out of the studio: ```bash (studio) $ exit ``` Now start a Docker container from that image. ```bash $ docker run -it -p 8000:8000 your_origin/sample-node-app ``` Now head to http://localhost:8000 and see your running app!