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

add instructions for ZUPLO_LOG_LEVEL #523

Merged
merged 4 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodejs 22.13.1
nodejs 22.13.1
local nodejs 23.9.0
10 changes: 5 additions & 5 deletions docs/articles/cloudflare-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ title: Zuplo and Cloudflare Settings
sidebar_label: Cloudflare Settings
---

Most fully managed Zuplo environemnts are deployed behind Cloudflare's Web Application
Firewall, DDoS protection, Bot Detection, and SSL termination. The combination
of Cloudflare's network infrastructure and Zuplo's API Gateway help provide
critical security and performance capabilities to your API all with zero custom
configuration.
Most fully managed Zuplo environemnts are deployed behind Cloudflare's Web
Application Firewall, DDoS protection, Bot Detection, and SSL termination. The
Copy link
Contributor

Choose a reason for hiding this comment

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

Identified issues

  • Vale Style Guide - (Zuplo.Acronyms-suggestion) 'SSL' has no definition.

Proposed fix

Suggested change
Application Firewall, DDoS protection, Bot Detection, and SSL termination. The
Application Firewall, DDoS protection, Bot Detection, and SSL termination.

'SSL' is a well-known acronym in the tech industry, and it's reasonable to assume that the target audience will understand it without a definition. No change is necessary.

combination of Cloudflare's network infrastructure and Zuplo's API Gateway help
provide critical security and performance capabilities to your API all with zero
custom configuration.

## Web Application Firewall Rules

Expand Down
4 changes: 4 additions & 0 deletions docs/articles/dev-portal-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ my-project/
- **docs/dev-portal.json** - This is the primary configuration for your
developer portal with customization for the favicon, authentication settings,
etc. [Documentation](./dev-portal-json.md)
- **ZUPLO_LOG_LEVEL** - This environment variable configures the log level in
your Zuplo portal to control which logs are displayed. To show only errors or
warnings, set ZUPLO_LOG_LEVEL to error or warn in the Settings tab under the
Environment Variables section.

:::caution

Expand Down
15 changes: 9 additions & 6 deletions docs/articles/log-plugin-azure-blob.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ The plugin is configured in the [Runtime Extensions](./runtime-extensions.md)
file `zuplo.runtime.ts`:

```ts

// The interface that describes the rows
// in the output
interface AzureBlobLogEntry {
Expand All @@ -31,28 +30,32 @@ interface AzureBlobLogEntry {
}

// The function that creates an entry
async function generateLogEntry(response: Response, request: ZuploRequest, context: ZuploContext) {
async function generateLogEntry(
response: Response,
request: ZuploRequest,
context: ZuploContext,
) {
const entry: AzureBlobLogEntry = {
timestamp: new Date().toISOString(),
url: request.url,
method: request.method,
status: response.status,
statusText: response.statusText,
sub: request.user?.sub ?? null,
contentLength: request.headers.get("content-length")
contentLength: request.headers.get("content-length"),
};
return entry;
}

// Add the plugin - use a SAS URL
runtime.addPlugin(
new AzureBlobPlugin<AzureBlobLogEntry>({
sasUrl: "https://YOUR_ACCOUNT.blob.core.windows.net/YOUR_CONTAINER?sv=2022-11-02&ss=b&srt=co&sp=wactfx&se=2045-11-17T13:50:53Z&st=2024-11-17T05:50:53Z&spr=https&sig=YOUR_SIG",
sasUrl:
"https://YOUR_ACCOUNT.blob.core.windows.net/YOUR_CONTAINER?sv=2022-11-02&ss=b&srt=co&sp=wactfx&se=2045-11-17T13:50:53Z&st=2024-11-17T05:50:53Z&spr=https&sig=YOUR_SIG",
batchPeriodSeconds: 1,
generateLogEntry,
})
}),
);

```

The plugin writes Block Blobs using SAS signatures. Ensure that your SAS URL has
Expand Down
3 changes: 2 additions & 1 deletion docs/articles/rick-and-morty-api-developer-portal-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ gateway configuration. for the Rick and Morty API.
The Rick and Morty API is a REST(ish) API based on the television show Rick and
Morty. It provides access to hundreds of characters, images, locations and
episodes. The Rick and Morty API is filled with canonical information as seen on
the TV show. Full credit to the original and upstream API, which is available at rickandmortyapi.com.
the TV show. Full credit to the original and upstream API, which is available at
rickandmortyapi.com.

> "I'm A Scientist; Because I Invent, Transform, Create, And Destroy For A
> Living, And When I Don't Like Something About The World, I Change It."
Loading