Skip to content

Template rendering using Wasp Configurations

Latest
Compare
Choose a tag to compare
@ashwanthkumar ashwanthkumar released this 28 Jan 16:18
· 1 commit to master since this release

Wasp CLI now supports generating files based on configuration values in WASP. We use the awesome Go Templates as template engine. Let's take a wasp configuration file

// wasp.tmpl
{
 "wasp": {
  "host": "{{ .wasp.host }}"
 }
}

You can now render the tmpl file using the wasp gen command as

$ wasp put dev.golang.wasp.host "http://localhost:9000"
$ wasp gen dev.golang /path/to/wasp.tmpl > ~/.indix/wasp.json
$ cat /path/to/config.json
{
 "wasp": {
  "host": "http://localhost:9000"
 }
}