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

feat: Add several demos #10

Merged
merged 2 commits into from
Mar 4, 2025
Merged

feat: Add several demos #10

merged 2 commits into from
Mar 4, 2025

Conversation

fabriziofiorucci
Copy link
Contributor

Proposed changes

Added

  • NGINX Advanced Healthcheck
  • NGINX API Steering
  • NGINX Docker Image Builder
  • NGINX Multicloud Gateway
  • NGINX NIM Docker
  • NGINX SOAP REST

Checklist

Before creating a PR, run through this checklist and mark each as complete:

@alessfg alessfg changed the title Added several demos feat: Add several demos Mar 4, 2025
@alessfg alessfg added the enhancement New feature or request label Mar 4, 2025
@alessfg alessfg requested review from alessfg and Copilot March 4, 2025 17:03
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR adds several demo implementations for various NGINX advanced features. Key changes include:

  • Implementation of NGINX API Steering logic with JSON payload transformations.
  • Addition of demo Flask applications for the API server and backend service.
  • Inclusion of Docker Compose and Kubernetes configuration files for deployment.

Reviewed Changes

File Description
NGINX-API-Steering/nginx/steering.js New API steering logic with subrequest handling and JSON updates.
NGINX-API-Steering/apiserver/apiserver.py Demo Flask API server implementation.
NGINX-API-Steering/backend/backend.py Demo Flask backend exposing rule data.
NGINX-API-Steering/docker-compose.yaml Docker Compose configuration for multi-container deployment.
NGINX-API-Steering/kubernetes.yaml Kubernetes deployment configuration for the demos.

Copilot reviewed 101 out of 101 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (4)

NGINX-API-Steering/nginx/steering.js:24

  • Consider verifying the type of 'enabled' rather than comparing to the string 'false'. If the expected value is a boolean, use a boolean check (e.g. if (!body.rule.enabled)).
if (body.rule.enabled == 'false') {

NGINX-API-Steering/nginx/steering.js:42

  • Declare the variable 'requestBody' in an outer scope before the if block so it is defined when used in the subsequent subrequest call.
if (r.requestText) {

NGINX-API-Steering/nginx/steering.js:135

  • [nitpick] The comment indicates a string is returned, but the function returns a JSON object. Update the comment to accurately reflect the return type.
// Return the updated JSON object as a string

NGINX-API-Steering/apiserver/apiserver.py:25

  • Store the result of request.get_json() in a variable to avoid calling the method twice, which improves readability and potential performance.
payload = request.get_json() if request.get_json() != None else ''

@alessfg alessfg added this pull request to the merge queue Mar 4, 2025
Merged via the queue into nginx:main with commit 89e66dd Mar 4, 2025
1 check passed
@fabriziofiorucci fabriziofiorucci deleted the ff20250226 branch March 4, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants