12 | { description } 13 |
-------------------------------------------------------------------------------- /hello-world/Readme.md: -------------------------------------------------------------------------------- 1 | # Deno Examples: Hello, World! 2 | 3 | Simply serving a single file over HTTP 4 | 5 | ## Get your own copy to explore 6 | 7 | You can clone this example into a repo of your own, and use it to set up a new application hosted on Deno Deploy in a few clicks 8 | 9 | [](https://app.deno.com/new?clone=https://github.com/denoland/examples&path=hello-world) -------------------------------------------------------------------------------- /with-apollo/schema.ts: -------------------------------------------------------------------------------- 1 | // A schema is a collection of type definitions (hence "typeDefs") 2 | // that together define the "shape" of queries that are executed against 3 | // your data. 4 | export const typeDefs = ` 5 | 6 | type Dinosaur { 7 | name: String 8 | description: String 9 | } 10 | 11 | type Query { 12 | dinosaurs: [Dinosaur] 13 | dinosaur(name: String): Dinosaur 14 | } 15 | `; 16 | -------------------------------------------------------------------------------- /with-prisma/prisma/schema.prisma: -------------------------------------------------------------------------------- 1 | generator client { 2 | provider = "prisma-client-js" 3 | previewFeatures = ["deno"] 4 | output = "../generated/client" 5 | } 6 | 7 | datasource db { 8 | provider = "postgresql" 9 | url = env("DATABASE_URL") 10 | } 11 | 12 | model Dinosaur { 13 | id Int @id @default(autoincrement()) 14 | name String @unique 15 | description String 16 | } 17 | -------------------------------------------------------------------------------- /with-trpc/server/trpc.ts: -------------------------------------------------------------------------------- 1 | import { initTRPC } from "@trpc/server"; 2 | 3 | /** 4 | * Initialization of tRPC backend 5 | * Should be done only once per backend! 6 | */ 7 | 8 | const t = initTRPC.create(); 9 | 10 | /** 11 | * Export reusable router and procedure helpers 12 | * that can be used throughout the router 13 | */ 14 | 15 | export const router = t.router; 16 | export const publicProcedure = t.procedure; 17 | -------------------------------------------------------------------------------- /with-vue/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |{{ dinosaur.description }}
12 |{props.count}
13 | 14 |Click on a dinosaur below to learn more.
9 | 10 |17 | {dino.description} 18 |
19 | See all 20 |23 | Check out 24 | create-vue, the official Vue + Vite starter 27 |
28 |Learn more about using Deno and Vite.
29 | 30 | 31 | 36 | -------------------------------------------------------------------------------- /with-hyperdx/otel-collector.yml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | endpoint: 0.0.0.0:4317 6 | http: 7 | endpoint: 0.0.0.0:4318 8 | 9 | exporters: 10 | otlphttp/hdx: 11 | endpoint: "https://in-otel.hyperdx.io" 12 | headers: 13 | authorization: "YOUR_HYPERDX_API_KEY" 14 | compression: gzip 15 | 16 | processors: 17 | batch: 18 | 19 | service: 20 | pipelines: 21 | traces: 22 | receivers: [otlp] 23 | processors: [batch] 24 | exporters: [otlphttp/hdx] 25 | metrics: 26 | receivers: [otlp] 27 | processors: [batch] 28 | exporters: [otlphttp/hdx] 29 | logs: 30 | receivers: [otlp] 31 | processors: [batch] 32 | exporters: [otlphttp/hdx] 33 | 34 | # ad5fde7d-184f-419f-8fc1-c74ef12d20cd 35 | -------------------------------------------------------------------------------- /with-fresh/main.ts: -------------------------------------------------------------------------------- 1 | import { App, staticFiles } from "fresh"; 2 | import { define, type State } from "./utils.ts"; 3 | 4 | export const app = new App16 | Click on a dinosaur below to learn more. 17 |
18 |{dinosaurSignal.value.description}
26 | 27 | Back to all dinosaurs 28 | 29 |Click on a dinosaur below to learn more.
17 |
25 | Edit src/App.tsx and save to test HMR
26 |
29 | Click on the Vite and React logos to learn more 30 |
31 | > 32 | ) 33 | } 34 | 35 | export default App 36 | -------------------------------------------------------------------------------- /with-fresh/routes/index.tsx: -------------------------------------------------------------------------------- 1 | import { useSignal } from "@preact/signals"; 2 | import { define } from "../utils.ts"; 3 | import Counter from "../islands/Counter.tsx"; 4 | 5 | export default define.page(function Home(ctx) { 6 | const count = useSignal(3); 7 | 8 | ctx.state.title = count.value + " Fresh Counter" + 9 | (Math.abs(count.value) === 1 ? "" : "s"); 10 | 11 | return ( 12 |
23 | Try updating this message in the
24 | ./routes/index.tsx file, and refresh.
25 |
Click on a dinosaur below to learn more.
24 |{dinosaur?.description}
34 |25 | This little example is being served by Deno. 26 | You can run it locally or in production on Deno Deploy or other hosting platforms. 27 |
28 |deno task devdeno deploydeno deploy --connected
38 | You can clone this example and deploy it to Deno Deploy in just a few clicks
39 |
40 |
27 | Hello, Deno! 28 |
29 | 30 |31 | This little example is being served by Deno. 32 | You can run it locally or in porduction on Deno Deploy or other hosting platforms. 33 |
34 |deno task devdeno deploydeno deploy --connected
44 | You can clone this example and deploy it to Deno Deploy in just a few clicks
45 |
46 |
27 | Hello, Deno! 28 |
29 | 30 |31 | This little example is being served by Deno. 32 | You can run it locally or in porduction on Deno Deploy or other hosting platforms. 33 |
34 |deno task devdeno deploydeno deploy --connected
44 | You can clone this example and deploy it to Deno Deploy in just a few clicks
45 |
46 |