Skip to content

relent0r/sample-node-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Habitat Sample Node App!

Hello! Welcome to the 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=you_origin
pkg_scaffolding="core/scaffolding-node"

Let's add in a version number

pkg_name=sample-node-app
pkg_origin=you_origin
pkg_scaffolding="core/scaffolding-node"
pkg_version="0.1.0"

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 your_origin/sample-node-app

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

  • Shell 51.7%
  • JavaScript 23.2%
  • CSS 15.1%
  • Pug 10.0%