Skip to content

Commit 30e6b1a

Browse files
committed
Allow importing apisprout from external packages
This can be useful for testing go code against the mock server. The mock server could be started in a go test and the tests are not dependant on a docker daemon or similar runtime. To start a server or get a http.Handler without passing a file path or URL, the server is separated into a server (`OpenAPIServer`) that only requires an `openapi3.T` to run and the loading from a file or URL is handled by a `ConfigReloader`. It can load from a URL or file path and reload the `OpenAPIServer` on file changes. Signed-off-by: leonnicolas <[email protected]>
1 parent 55a1793 commit 30e6b1a

File tree

11 files changed

+1394
-302
lines changed

11 files changed

+1394
-302
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
22
vendor
33
logo.png
4-
apisprout
4+
/apisprout
55
apisprout.exe
66
apisprout*.zip
77
apisprout*.xz

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WORKDIR /apisprout
33
COPY . .
44
RUN apk add --no-cache git && \
55
go get github.com/ahmetb/govvv && \
6-
govvv install
6+
govvv install ./cmd/apisprout
77

88
FROM alpine:3.8
99
COPY --from=build /go/bin/apisprout /usr/local/bin/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Download the appropriate binary from the [releases](https://github.com/danielgta
6161
Alternatively, you can use `go get`:
6262

6363
```sh
64-
go get github.com/danielgtaylor/apisprout
64+
go get github.com/danielgtaylor/apisprout/cmd/apisprout
6565
```
6666

6767
## Extra Features

0 commit comments

Comments
 (0)