Skip to content

modrake/sample-node-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Habitat Sample Node App

Welcome to the Habitat Sample Node App!

habitat-sample-node-app

Instructions

To practice packaging/running this app with Habitat

Workstation Prereqs:

$  git clone https://github.com/habitat-sh/sample-node-app.git
  • Change directories
$ cd sample-node-app

Building the Package:

You'll see a directory called habitat. Open the habitat/plan.sh file:

Your habitat/plan.sh should look like this:

pkg_name=sample-node-app
pkg_origin=your_origin
pkg_scaffolding="core/scaffolding-node"

Let's add in a version number

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

$ hab studio enter

And run build

(studio) $ build

Running the Package with Docker

Still in your studio, right after the build, export that package to a docker image

(studio) $ hab pkg export docker ./results/<habitat artifact>.hart

Then exit out of the studio:

(studio) $ exit

Now start a Docker container from that image.

$ docker run -it -p 8000:8000 your_origin/sample-node-app

Now head to http://localhost:8000 and see your running app!

About

Sample Node App to Habitize!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 68.4%
  • CSS 15.2%
  • HTML 12.0%
  • Shell 4.4%