Passed
Push — main ( 96cc3c...3f510d )
by Martin
53s queued 14s
created

app.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 28
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
mnd 0
bc 0
fnc 1
dl 0
loc 28
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 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}`);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
28
});
29