code: func (s *Server) Generate() error {
  	s.Resources = getAllResources(s.APIDef, true)
  
  	if err := generateAllObjects(s.APIDef, s.Dir); err != nil {
  		return err
  	}
  
  	// main file
  	if err := s.generateMain(); err != nil {
  		return err
  	}
  
  	// API implementation
  	if err := generateResourceAPIs(s.Resources, s.Dir); err != nil {
  		return err
  	}
  
  	// security related files
  	if err := s.generateSecurity(); err != nil {
  		return err
  	}
  
  	// HTML front page
  	if err := commons.GenerateFile(s, "./templates/index.html.tmpl", "index.html", filepath.Join(s.Dir, "index.html"), false); err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // Generate implements generator.Server.Generate interface