We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08d1e33 commit 7f73dffCopy full SHA for 7f73dff
src/app.ts
@@ -1,12 +1,14 @@
1
import express from "express";
2
import dotenv from "dotenv";
3
import indexRouter from "./routes";
4
+import userRoute from "./routes/users";
5
6
dotenv.config();
7
8
const app = express();
9
10
app.use(express.json());
11
app.use("/", indexRouter);
12
+app.use("/users", userRoute);
13
14
export default app;
src/routes/users.ts
@@ -0,0 +1,11 @@
+import { Router } from "express";
+
+const userRoute = Router();
+userRoute.get("/", (_req, res) => {
+ res.json({
+ message: "This is users route",
+ });
+});
+export default userRoute;
0 commit comments