Add example to build single binary with templates (#1328)

This commit is contained in:
JINNOUCHI Yasushi
2018-04-22 16:04:38 +09:00
committed by Bo-Yi Wu
parent dfe37ea6f1
commit 814ac9490a
8 changed files with 175 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
# Building a single binary containing templates
This is a complete example to create a single binary with the
[gin-gonic/gin][gin] Web Server with HTML templates.
[gin]: https://github.com/gin-gonic/gin
## How to use
### Prepare Packages
```
go get github.com/gin-gonic/gin
go get github.com/jessevdk/go-assets-builder
```
### Generate assets.go
```
go-assets-builder html -o assets.go
```
### Build the server
```
go build -o assets-in-binary
```
### Run
```
./assets-in-binary
```