~sergiusens/snapcraft/meta-all-yaml

« back to all changes in this revision

Viewing changes to docs/tutorial.md

  • Committer: Snappy Tarmac
  • Author(s): Daniel Holbach
  • Date: 2015-08-05 13:11:41 UTC
  • mfrom: (120.2.5 snapcraft)
  • Revision ID: snappy_tarmac-20150805131141-rlqzw828lx4piwv3
Small doc markup fixes. by dholbach approved by sergiusens,longsleep

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        panic(http.ListenAndServe(":8080", http.FileServer(http.Dir("."))))
41
41
    }
42
42
 
43
 
This will serve the current directory on port :8080. If there is an index.html
44
 
in the current directory, it will be served. Otherwise a directory listing will
45
 
be shown.
 
43
This will serve the current directory on port `:8080`. If there is an 
 
44
`index.html` in the current directory, it will be served. Otherwise a 
 
45
directory listing will be shown.
46
46
 
47
47
I've provided the above code in a simple GitHub
48
48
[repository](https://github.com/mikix/golang-static-http).
91
91
 
92
92
You'll see a bunch of output, including Snapcraft downloading the Go compiler.
93
93
It will use this to compile the code found on GitHub. Eventually when it is
94
 
done, you'll be able to inspect the ./stage folder and see the web server
95
 
executable sitting in ./stage/bin:
 
94
done, you'll be able to inspect the `./stage` folder and see the web server
 
95
executable sitting in `./stage/bin`:
96
96
 
97
97
    $ ls stage/bin
98
98
    golang-static-http
117
117
 
118
118
    $ snapcraft stage
119
119
 
120
 
You'll note that Snapcraft skipped downloading and building golang-static-htpp
121
 
again because it knew it had already done so.
 
120
You'll note that Snapcraft skipped downloading and building 
 
121
`golang-static-htpp` again because it knew it had already done so.
122
122
 
123
123
You'll also see Snapcraft downloading and unpacking all the Ubuntu packages
124
 
into your snap. If you look at ./stage, you'll see a lot more files now:
 
124
into your snap. If you look at `./stage`, you'll see a lot more files now:
125
125
 
126
126
    $ ls stage
127
127
    bin  etc  lib  usr  var
164
164
 
165
165
The `copy` plugin takes a list of files to just directly copy without building
166
166
or downloading anything. In this case, we just want to put our glue script in
167
 
the bin/ directory.
 
167
the `bin/` directory.
168
168
 
169
169
If we run Snapcraft again, we won't be surprised:
170
170