Skip to content

Commit fb67524

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 <leonloechner@gmx.de>
1 parent 55a1793 commit fb67524

File tree

9 files changed

+1316
-301
lines changed

9 files changed

+1316
-301
lines changed

Dockerfile

+1-1
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

+1-1
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)