github.com/djarvur/go-swagger@v0.18.0/examples/tutorials/custom-server/README.md (about) 1 # Go-Swagger: Custom Server Example 2 3 An example project, showcasing how one can create a custom OpenAPI-based Go server, 4 using go-swagger to generate its core. 5 6 You can regenerate the `./gen` directory using the [swagger][] cli: 7 8 ```bash 9 $ rm -rf gen && swagger generate server --exclude-main -A greeter -t gen -f ./swagger/swagger.yml 10 ``` 11 12 Running the _greeter_ server on port `3000` is as simple as: 13 14 ```bash 15 $ go run ./cmd/greeter/main.go --port 3000 16 ``` 17 18 You can test the server using [httpie][] as follows: 19 20 ```bash 21 $ http get :3000/hello # returns 'Hello, World!' 22 $ http get :3000/hello name==Swagger # returns 'Hello, Swagger!' 23 ``` 24 25 [swagger]: https://github.com/go-swagger/go-swagger 26 [httpie]:https://httpie.org