ivandpf
ivandpf6mo ago

Starting project errors

I have error in url of Deno
No description
19 Replies
NeTT
NeTT6mo ago
it's coz of two reasons: 1. The URL was prolly not cached yet 2. You haven't specified a version in the URL so it will implicitly fetch the latest version of the lib the first issue will be gone with a cache dependencies command the second, try using an explicit version like https://deno.land/x/oak@v13.2.5/mod.ts
ivandpf
ivandpf6mo ago
No description
ivandpf
ivandpf6mo ago
Red too. And I reopen vs code.
ivandpf
ivandpf6mo ago
I try to install denon and no works
No description
ivandpf
ivandpf6mo ago
Why that have a lot of problems
NeTT
NeTT6mo ago
NeTT
NeTT6mo ago
the command palette can be opened with ctrl+shift+p
ivandpf
ivandpf6mo ago
Leokuma
Leokuma6mo ago
How did you install Deno?
ivandpf
ivandpf6mo ago
Chocolatey
akumaruь
akumaruь6mo ago
try enabling deno for current workspace sorry for offtopic quesiton, but what did you use for recordin it?
ivandpf
ivandpf6mo ago
How
akumaruь
akumaruь6mo ago
type Enable instead of cache
ivandpf
ivandpf6mo ago
Thanks works. And that error?
No description
akumaruь
akumaruь6mo ago
i don't think it's a valid code
import { Application } from "https://deno.land/x/oak/mod.ts";

const app = new Application();

app.use((ctx) => {
ctx.response.body = "Hello World!";
});

await app.listen({ port: 8000 });
import { Application } from "https://deno.land/x/oak/mod.ts";

const app = new Application();

app.use((ctx) => {
ctx.response.body = "Hello World!";
});

await app.listen({ port: 8000 });
from official docs https://deno.land/x/oak@v13.2.5
ivandpf
ivandpf6mo ago
Yes but I want routes
akumaruь
akumaruь6mo ago
import { Application, Router } from "https://deno.land/x/oak/mod.ts";

const router = new Router();
router
.get("/", (context) => {
context.response.body = "Hello world!";
})

const app = new Application();
app.use(router.routes());
app.use(router.allowedMethods());

await app.listen({ port: 8000 }
import { Application, Router } from "https://deno.land/x/oak/mod.ts";

const router = new Router();
router
.get("/", (context) => {
context.response.body = "Hello world!";
})

const app = new Application();
app.use(router.routes());
app.use(router.allowedMethods());

await app.listen({ port: 8000 }
ivandpf
ivandpf6mo ago
Thank youuu.
NeTT
NeTT6mo ago
snipping tool