Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 9 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,14 @@ jobs:
version: latest


- name: Build
run: deno run -A ./cmd/build.ts

- name: Install Dependencies
run: pnpm install
working-directory: ./examples/netlify

- name: Install example
- name: Start
run: |
pnpm add @upstash/redis@../../dist
npm i -g netlify-cli
working-directory: ./examples/netlify-edge

- name: Start example
run: netlify dev --port 15015 & sleep 10
npx netlify-cli dev --port 15015 & sleep 10
working-directory: ./examples/netlify-edge


Expand All @@ -158,6 +154,7 @@ jobs:
DEPLOYMENT_URL: http://localhost:15015

netlify-edge-deployed:
if: false
concurrency: netlify-edge-deployed
runs-on: ubuntu-latest
needs:
Expand All @@ -180,8 +177,8 @@ jobs:



- name: Install @upstash/redis
run: pnpm add @upstash/redis@${{needs.release.outputs.version}}
- name: Install Dependencies
run: pnpm install
working-directory: ./examples/netlify

- name: Deploy
Expand Down Expand Up @@ -862,7 +859,7 @@ jobs:
- nextjs-edge-local
- netlify-local
- deno-local
# - netlify-edge-local - not working in ci for some reason, local is fine
# - netlify-edge-local - their own cli doesn't work right now. I'll try again in a week
- cloudflare-workers-with-typescript-local
- cloudflare-workers-local

Expand Down
3 changes: 0 additions & 3 deletions examples/netlify-edge/netlify.toml

This file was deleted.

3 changes: 3 additions & 0 deletions examples/netlify-edge/netlify/edge-functions/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default () => new Response("Hello world");

export const config = { path: "/test" };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Context } from "https://edge.netlify.com";
import { Redis } from "https://deno.land/x/upstash_redis/mod.ts";
import { Redis } from "../../../../mod.js";

const redis = Redis.fromEnv();
export default async (_req: Request, _ctx: Context) => {
export default async (_req: Request) => {
console.log("Hello");
try {
return new Response(JSON.stringify({
Expand All @@ -14,3 +13,5 @@ export default async (_req: Request, _ctx: Context) => {
return new Response(err.message, { status: 500 });
}
};

export const config = { path: "/incr" };
2 changes: 1 addition & 1 deletion examples/netlify-edge/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!deploymentURL) {

Deno.test("works", async () => {
console.log({ deploymentURL });
const url = `${deploymentURL}/handler`;
const url = `${deploymentURL}/incr`;
console.log({ url });
const res = await fetch(url);
const body = await res.text();
Expand Down
4 changes: 3 additions & 1 deletion platforms/nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export class Redis extends core.Redis {
});

this.addTelemetry({
runtime: `node@${process.version}`,
runtime: typeof EdgeRuntime === "string"
? "edge-light"
: `node@${process.version}`,
platform: process.env.VERCEL
? "vercel"
: process.env.AWS_REGION
Expand Down