# How to prepare the source code correctly?

**URL:** <https://discourse.chef.io/t/how-to-prepare-the-source-code-correctly/12170>\
**Category:** Chef Habitat\
**Created:** [August 31, 2016, 2:33pm UTC](https://discourse.chef.io/t/how-to-prepare-the-source-code-correctly/12170 "2016-08-31T14:33:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@martin](https://discourse.chef.io/u/martin)\
**Post date:** [August 31, 2016, 2:33pm UTC](https://discourse.chef.io/t/how-to-prepare-the-source-code-correctly/12170/1 "2016-08-31T14:33:10Z")

</div>

There is a huge leap from this comment, [“You are not expected to take any action in this step”](https://www.habitat.sh/tutorials/getting-started-review-source-files/) to this required action, [“Change the ‘pkg\_source’ value to point to the archive file that contains the source files described in the previous step”](https://www.habitat.sh/tutorials/getting-started-create-plan/), without any helpful instructions in between.

I’ve tried every file and directory structure and compression command I can think of, but always hit an error of one kind or another.

My most recent attempt :

```
me@mine:~/tinyhttp$ tar -ztvf ${pkg_filename}
drwxrwxr-x me/me 0 2016-08-31 09:18 mytutorialapp-0.2.0/
-rw-rw-r-- me/me 399 2016-08-31 09:14 mytutorialapp-0.2.0/package.json
drwxrwxr-x me/me 0 2016-08-31 06:59 mytutorialapp-0.2.0/config/
-rw-rw-r-- me/me 55 2016-08-31 06:53 mytutorialapp-0.2.0/config/config.json
-rw-rw-r-- me/me 424 2016-08-31 08:39 mytutorialapp-0.2.0/server.js
-rw-rw-r-- me/me 33 2016-08-31 09:15 mytutorialapp-0.2.0/README.md
me@mine:~/tinyhttp$ 

```

But I edited `server.js` to access `config.json` internally, like this :

```
nconf.file({ file: './config/config.json' });

```

When originally it’s like this :

```
nconf.file({ file: '../config/config.json' });

```

So, not surprisingly, my end result when testing the docker image is :

```
mytutorialapp(SV): Starting
mytutorialapp(O): 
mytutorialapp(O): > mytutorialapp@0.2.0 start /hab/svc/mytutorialapp/var
mytutorialapp(O): > node server.js
mytutorialapp(O): 
mytutorialapp(O): Running on http://0.0.0.0:NaN

```

(The port number can’t be found.)

I started the tutorial 4 hours ago. Most of that time has been trial and error responding to errors resulting from guessing those critical but undocumented steps.

I need a complete explanation of :

1. the proper layout for the source code
2. how to test it with NodeJS before making the tarball
3. the command to create the tarball, (ie; should it contain the directory, or just the directory contents)
