50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
|
/*
|
||
|
YetAnotherToDoList
|
||
|
Copyright © 2023 gilex-dev gilex-dev@proton.me
|
||
|
|
||
|
This program is free software: you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation, version 3.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
package cmd
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
"somepi.ddns.net/gitea/gilex-dev/YetAnotherToDoList/server"
|
||
|
)
|
||
|
|
||
|
// serverCmd represents the server command
|
||
|
var serverCmd = &cobra.Command{
|
||
|
Use: "server",
|
||
|
Short: "Start web server",
|
||
|
Long: `Start the web server with a GraphQL playground`,
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
fmt.Println("server called")
|
||
|
server.StartServer()
|
||
|
},
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
rootCmd.AddCommand(serverCmd)
|
||
|
|
||
|
// Here you will define your flags and configuration settings.
|
||
|
|
||
|
// Cobra supports Persistent Flags which will work for this command
|
||
|
// and all subcommands, e.g.:
|
||
|
// serverCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||
|
|
||
|
// Cobra supports local flags which will only run when this command
|
||
|
// is called directly, e.g.:
|
||
|
// serverCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||
|
}
|