DenoDDeno
Powered by
AzeA
Denoβ€’2y agoβ€’
5 replies
Aze

Missing express types

Hey, I'm trying to use deno 1.46.3 with
express
express
+
@types/express
@types/express
, but it seems the types aren't being applied

What can I do?
// @deno-types="@types/express"
import express from "express";

const app = express();
const port = Deno.env.get("APP_PORT") || 3000;

app.get("/:name", (request, response) => {
  const name: string = request.params.name;
  response.send("Hello " + name);
});

if (import.meta.main) {
  app.listen(port, () => 
    console.log(`Listening on :${port}`)
  );
}
// @deno-types="@types/express"
import express from "express";

const app = express();
const port = Deno.env.get("APP_PORT") || 3000;

app.get("/:name", (request, response) => {
  const name: string = request.params.name;
  response.send("Hello " + name);
});

if (import.meta.main) {
  app.listen(port, () => 
    console.log(`Listening on :${port}`)
  );
}
image.png
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

express types
underscoreUunderscore / help
17mo ago
NPM Import missing types
BillionzBBillionz / help
4y ago
Deno express typescript is not working
Tal MikeyTTal Mikey / help
2y ago