Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 28 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import express from "express"; |
||
2 | import cors from "cors"; |
||
3 | import dotenv from "dotenv"; |
||
4 | import morgan from "morgan"; |
||
5 | // import errorHandler from "./middleware/errors.js"; |
||
6 | // import apiRouter from "./routes/v1/index.js"; |
||
7 | |||
8 | dotenv.config(); |
||
9 | |||
10 | const app = express(); |
||
11 | const port = 1337; |
||
12 | |||
13 | app.use(morgan("dev")); |
||
14 | |||
15 | app.use(cors()); |
||
16 | app.use(express.json()); |
||
17 | |||
18 | app.use(express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded |
||
19 | |||
20 | // Här kan vi lägga in en middleware för att kolla API-nyckel? |
||
21 | |||
22 | // app.use("/v1", apiRouter); |
||
23 | |||
24 | // app.use(errorHandler); |
||
25 | |||
26 | app.listen(port, () => { |
||
27 | console.log(`Server running on port ${port}`); |
||
|
|||
28 | }); |
||
29 |