Skip to content

An example of one way to package a web site and web server with Habitat and Nginx.

Notifications You must be signed in to change notification settings

cnunciato/hello-hab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hello-hab

An example of one way to package a web site and web server with Habitat and Nginx.

First, download and install Habitat, then follow the instructions to create an account and create an origin. Then:

1. Make sure this works:

$ hab --version
hab 0.29.1/20170810235219

2. Enter the studio:

$ export HAB_ORIGIN="your-origin"
$ export HAB_DOCKER_OPTS="-p 8080:80" # If you're building on Mac or Windows
$ hab studio enter

3. Build both packages and start the server:

[1][default:/src:0]# build site
[2][default:/src:0]# build server
[3][default:/src:0]# hab start $HAB_ORIGIN/hello-hab-server

4. Browse to the server at http://localhost:8080.

You should see a blank page.

5. Reconfigure the server to use content from the web-site package:

[3][default:/src:0]# echo "[http.server]
root = '$(hab pkg path $HAB_ORIGIN/hello-hab-site)/dist'" | hab config apply hello-hab-server.default 1
» Applying configuration for hello-hab-server.default incarnation 1
Ω Creating service configuration
✓ Verified this configuration is valid TOML
↑ Applying to peer 127.0.0.1:9638
★ Applied configuration

You should no longer see a blank page!

About

An example of one way to package a web site and web server with Habitat and Nginx.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published