1234567891011121314151617181920212223242526272829 |
- package main
- import (
- "flag"
- "fmt"
- "log"
- "net/http"
- "rate-it-api/utils"
- )
- func main() {
- router := APIRouter()
- port := flag.String("port", "8080", "API port")
- configFile := flag.String("config", "./config/config.yml", "Configuration file")
- flag.Parse()
- // set configuration
- utils.SetConfig(*configFile)
- //Running
- fmt.Println(fmt.Sprintf("->Running Rate-it API on 0.0.0.0:%s", *port))
- fmt.Println(fmt.Sprintf("->Running Rate-it API with configuration file %s ", *configFile))
- log.Fatal(http.ListenAndServe(":"+*port, router))
- }
|