Make swagger main stop being generated. Default Port 9090 (#3)

* Make swagger main stop being generated

* Update Readme

* Remove Warning
This commit is contained in:
Daniel Valdivia
2020-04-02 11:31:48 -07:00
committed by GitHub
parent e0c5bc5553
commit e2c95b5be1
4 changed files with 9 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ mcs:
swagger-gen:
@echo "Generating swagger server code from yaml"
@swagger generate server -A mcs -f ./swagger.yml -r NOTICE
@swagger generate server -A mcs --main-package=mcs --exclude-main -f ./swagger.yml -r NOTICE
build:
@(cd portal-ui; yarn install; make build; cd ..)

View File

@@ -57,10 +57,10 @@ To run the server:
export MCS_ACCESS_KEY=mcs
export MCS_SECRET_KEY=YOURMCSSECRET
export MCS_MINIO_SERVER=http://localhost:9000
./mcs --port=52300
./mcs
```
You can verify that the apis work by doing the request on `localhost:52300/api/v1/...`
You can verify that the apis work by doing the request on `localhost:9090/api/v1/...`
# Development

View File

@@ -1,5 +1,3 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2020 MinIO, Inc.
//
@@ -20,6 +18,7 @@
package main
import (
"flag"
"log"
"os"
@@ -29,8 +28,7 @@ import (
"github.com/minio/m3/mcs/restapi/operations"
)
// This file was generated by the swagger tool.
// Make sure not to overwrite this file after you generated it because all your edits would be lost!
var portFlag = flag.Int("port", 9090, "Port to run this service on")
func main() {
@@ -63,8 +61,10 @@ func main() {
}
os.Exit(code)
}
// Parse flags
flag.Parse()
server.ConfigureAPI()
server.Port = *portFlag
if err := server.Serve(); err != nil {
log.Fatalln(err)

View File

@@ -54,7 +54,7 @@
"last 1 safari version"
]
},
"proxy": "http://localhost:52300",
"proxy": "http://localhost:9090",
"devDependencies": {
"prettier": "^1.19.1"
}