Skip to content

Commit b9e63e6

Browse files
committed
Actually include package.json etc. in this commit
1 parent 0738758 commit b9e63e6

File tree

3 files changed

+2266
-0
lines changed

3 files changed

+2266
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import express from "express";
2+
import contactsRouter from "./api/contacts.js";
3+
4+
const app = express();
5+
const router = express.Router();
6+
7+
const port = process.env.PORT || 3000;
8+
9+
// Parse URL-encoded bodies (as sent by HTML forms)
10+
app.use(express.urlencoded({ extended: true }));
11+
// Parse JSON bodies (as sent by API clients)
12+
app.use(express.json());
13+
14+
router.use("/contacts", contactsRouter);
15+
16+
app.use("/api", router);
17+
18+
app.listen(port, () => console.log(`Server listening on port ${port}!`));

0 commit comments

Comments
 (0)