completed exercise 3.1

This commit is contained in:
counterweight 2025-05-31 22:51:30 +02:00
parent 68aa0e9905
commit 0bd43956c9
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
604 changed files with 67855 additions and 0 deletions

View file

@ -0,0 +1,35 @@
const express = require("express");
const app = express();
app.use(express.json());
const PORT = 3001;
app.get("/api/persons", (request, response) => {
response.json([
{
id: "1",
name: "Arto Hellas",
number: "040-123456",
},
{
id: "2",
name: "Ada Lovelace",
number: "39-44-5323523",
},
{
id: "3",
name: "Dan Abramov",
number: "12-43-234345",
},
{
id: "4",
name: "Mary Poppendieck",
number: "39-23-6423122",
},
]);
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});