Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Dev deployment capability #101

Merged
merged 20 commits into from
Nov 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Using dedicated folder for Swagger doc
  • Loading branch information
hirenkp2000 committed Nov 17, 2023
commit 46c3e0510151ddbbf2b4b744534b211b48bb0a85
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ cd xyz-hub
gradle clean build
```

### Build standalone Jar
### Run App

The service could also be started directly from a fat jar. In this case Postgres and the other optional dependencies need to be started separately.

@@ -82,6 +82,10 @@ java -jar build/libs/naksha-2.0.6-all.jar mock-config

Then use a web browser to connect to `localhost:8080`, an OK message should be displayed if the service is up and running.

### OpenAPI specification

Once application is UP, the OpenAPI specification is accessible at `http(s)://{host}:{port}/hub/swagger/index.html`, by default at [http://localhost:8080/hub/swagger/index.html](http://localhost:8080/hub/swagger/index.html)

### Configuration

The service persists out of modules with a bootstrap code to start the service. Service provides default configuration in [default-config.json](here-naksha-lib-hub/src/main/resources/config/default-config.json).
@@ -186,15 +190,6 @@ The service will respond with the inserted geo features:
}
```

### OpenAPI specification

The OpenAPI specification files are accessible under the following URIs:
* Full: [http://{host}:{port}/hub/static/openapi/full.yaml](http://localhost:8080/hub/static/openapi/full.yaml)
* Stable: [http://{host}:{port}/hub/static/openapi/stable.yaml](http://localhost:8080/hub/static/openapi/stable.yaml)
* Experimental: [http://{host}:{port}/hub/static/openapi/experimental.yaml](http://localhost:8080/hub/static/openapi/experimental.yaml)
* Contract: [http://{host}:{port}/hub/static/openapi/contract.yaml](http://localhost:8080/hub/static/openapi/contract.yaml)
* Connector: [http://{host}:{port}/psql/static/openapi/openapi-http-connector.yaml](http://localhost:8080/psql/static/openapi/openapi-http-connector.yaml)

# Acknowledgements

XYZ Hub uses:
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ public NakshaHttpVerticle(@NotNull INaksha naksha, int index, @NotNull NakshaApp

@Override
public void start(final @NotNull Promise<Void> startPromise) {
RouterBuilder.create(vertx, "static/openapi.yaml").onComplete(ar -> {
RouterBuilder.create(vertx, "swagger/openapi.yaml").onComplete(ar -> {
try {
if (ar.failed()) {
throw ar.cause();
@@ -195,6 +195,8 @@ public void start(final @NotNull Promise<Void> startPromise) {

// Static resources route.
router.route("/hub/static/*").handler(this::onResourceRequest);
// Swagger doc route.
router.route("/hub/swagger/*").handler(this::onResourceRequest);

// Optional: Web server.
if (staticHandler != null) {
@@ -266,7 +268,7 @@ private void onResourceRequest(@NotNull RoutingContext routingContext) {
sendRawResponse(routingContext, OK, contentType(path), cachedBuffer);
return;
}
if (!path.startsWith("/hub/static/")) {
if (!path.startsWith("/hub/static/") && !path.startsWith("/hub/swagger/")) {
routingContext.next();
return;
}