Skip to content

Commit f8a96c7

Browse files
committed
Explainer
1 parent 0a2147f commit f8a96c7

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
import express from "express";
1+
import express, { RequestHandler } from "express";
22

33
const app = express();
44

5-
app.get("/user", (req, res) => {
6-
res.send("Hello");
7-
});
5+
// /user?id=124123
6+
const getUser: RequestHandler<
7+
any,
8+
{
9+
name: string;
10+
},
11+
any,
12+
{
13+
id: string;
14+
}
15+
> = (req, res) => {
16+
req.query.id;
17+
};
18+
19+
app.get("/user");
20+
21+
app.post("/user", (req, res) => {});
822

923
app.listen(3000);

0 commit comments

Comments
 (0)