ivandpf
ivandpf15mo ago

Starting project errors

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

Did you find this page helpful?