code: func (g *Generator) Generate() (_ []string, err error) {
  	if g.API == nil {
  		return nil, fmt.Errorf("missing API definition, make sure design is properly initialized")
  	}
  
  	go utils.Catch(nil, func() { g.Cleanup() })
  
  	defer func() {
  		if err != nil {
  			g.Cleanup()
  		}
  	}()
  
  	if g.Timeout == 0 {
  		g.Timeout = 20 * time.Second
  	}
  	if g.Scheme == "" && len(g.API.Schemes) > 0 {
  		g.Scheme = g.API.Schemes[0]
  	}
  	if g.Scheme == "" {
  		g.Scheme = "http"
  	}
  	if g.Host == "" {
  		g.Host = g.API.Host
  	}
  	if g.Host == "" {
  		return nil, fmt.Errorf("missing host value, set it with --host")
  	}
  
  	g.OutDir = filepath.Join(g.OutDir, "js")
  	if err := os.RemoveAll(g.OutDir); err != nil {
  		return nil, err
  	}
  	if err := os.MkdirAll(g.OutDir, 0755); err != nil {
  		return nil, err
  	}
  	g.genfiles = append(g.genfiles, g.OutDir)
  
  	// Generate client.js
  	exampleAction, err := g.generateJS(filepath.Join(g.OutDir, "client.js"))
  	if err != nil {
  		return
  	}
  
  	// Generate axios.html
  	if err = g.generateAxiosJS(); err != nil {
  		return
  	}
  
  	if exampleAction != nil && !g.NoExample {
  		// Generate index.html
  		if err = g.generateIndexHTML(filepath.Join(g.OutDir, "index.html"), exampleAction); err != nil {
  			return
  		}
  
  		// Generate example
  		if err = g.generateExample(); err != nil {
  			return
  		}
  	}
  
  	return g.genfiles, nil
  }
docs: // Generate produces the skeleton main.