-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (26 loc) · 702 Bytes
/
index.js
File metadata and controls
30 lines (26 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const express = require("express");
const app = express();
const Auth = require("./controller/auth/authController");
const Add = require("./controller/auth/add")
const Creds = require('./controller/auth/credentialController')
const port = 3000;
app.use("/credential", Creds);
app.use("/add", Add);
const person = [
{ name: "Ali", age: 20 },
{ name: "ahmad", age: 30 },
{ name: "umar", age: 40 },
];
app.get("/", (req, res) => {
res.send("Hello World!");
});
app.get("/person", (req, res) => {
res.status(200).json({
message: "Data Loaded...",
person,
});
});
app.use("/auth", Auth);
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});