Skip to content

Commit 4ee3168

Browse files
committed
codegen refactor
1 parent ad43e04 commit 4ee3168

File tree

8 files changed

+79
-29
lines changed

8 files changed

+79
-29
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/go-postgres-sockets.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/go-postgres-sockets/main.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* User API
3+
*
4+
* A notifications proof of concept API
5+
*
6+
* API version: 0.1.0
7+
* Contact: [email protected]
8+
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
9+
*/
10+
11+
package main
12+
13+
import (
14+
"github.com/bebo-dot-dev/go-postgres-sockets/server/api"
15+
"github.com/gorilla/handlers"
16+
"log"
17+
"net/http"
18+
)
19+
20+
func main() {
21+
log.Printf("Server started")
22+
23+
service := api.NewNotificationsAPIApiService()
24+
controller := api.NewNotificationsAPIApiController(service)
25+
26+
router := api.NewRouter(controller)
27+
28+
corsOrigins := handlers.AllowedOrigins([]string{"https://editor.swagger.io"})
29+
corsHeaders := handlers.AllowedHeaders([]string{"X-Requested-With", "Content-Type", "Authorization"})
30+
corsMethods := handlers.AllowedMethods([]string{"GET", "POST", "PUT", "HEAD", "OPTIONS"})
31+
log.Fatal(http.ListenAndServe(":8080", handlers.CORS(corsOrigins, corsHeaders, corsMethods)(router)))
32+
}

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/bebo-dot-dev/go-postgres-sockets
2+
3+
go 1.16
4+
5+
require (
6+
github.com/bebo-dot-dev/go-postgres-sockets/server v0.0.0-20210731201516-ad43e0448ced
7+
github.com/gorilla/handlers v1.5.1
8+
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
github.com/bebo-dot-dev/go-postgres-sockets/server v0.0.0-20210731201516-ad43e0448ced h1:36aP+l+pujgDFgc4RGb9fewgz48qHdd7DqYeK3Cff8Y=
2+
github.com/bebo-dot-dev/go-postgres-sockets/server v0.0.0-20210731201516-ad43e0448ced/go.mod h1:Xmn1npnTA0ZOLx9iYiJCMCJF/2WVnM7MnA3Ng0NO4r0=
3+
github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
4+
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
5+
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
6+
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
7+
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
8+
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=

server/main.go

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)