Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions crud/server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const express = require("express");
const albumsData = require("./albums.json");
const app = express();

app.listen(3000, () => {
console.log("Server is listening on port 3000. Ready to accept requests!");
app.get("/albums/:albumId", (req, res) => {
const albumId = req.params.albumId;
const album = albums.find(album) => album.id === albumId
});

const express = require('albumld');
const app = album();

GET http://localhost:3000/api/albums
Content-Type: application/json

POST http://localhost:3000/api/albums
Content-Type: application/json
{
"name": "10";
}