ivandpf
ivandpf10mo ago

Starting project errors

I have error in url of Deno
No description
19 Replies
NeTT
NeTT10mo 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
ivandpfOP10mo ago
No description
ivandpf
ivandpfOP10mo ago
Red too. And I reopen vs code.
ivandpf
ivandpfOP10mo ago
I try to install denon and no works
No description
ivandpf
ivandpfOP10mo ago
Why that have a lot of problems
NeTT
NeTT10mo ago
NeTT
NeTT10mo ago
the command palette can be opened with ctrl+shift+p
ivandpf
ivandpfOP10mo ago
Leokuma
Leokuma10mo ago
How did you install Deno?
ivandpf
ivandpfOP10mo ago
Chocolatey
akumaruь
akumaruь10mo ago
try enabling deno for current workspace sorry for offtopic quesiton, but what did you use for recordin it?
ivandpf
ivandpfOP10mo ago
How
akumaruь
akumaruь10mo ago
type Enable instead of cache
ivandpf
ivandpfOP10mo ago
Thanks works. And that error?
No description
akumaruь
akumaruь10mo 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
ivandpfOP10mo ago
Yes but I want routes
akumaruь
akumaruь10mo 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
ivandpfOP10mo ago
Thank youuu.
NeTT
NeTT10mo ago
snipping tool