-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.ts
More file actions
26 lines (18 loc) · 759 Bytes
/
server.ts
File metadata and controls
26 lines (18 loc) · 759 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
import express from "express";
import cors from "cors";
import pingController from "./src/controllers/pingController";
import authController from "./src/controllers/authController";
import usersController from "./src/controllers/usersController";
import tasksController from "./src/controllers/tasksController";
const app = express();
const port = 8000;
app.use(express.json()); // for parsing application/json
app.use(express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use(cors());
app.use("/ping", pingController);
app.use("/auth", authController);
app.use("/users", usersController);
app.use("/tasks", tasksController);
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});