mongodb241 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mongodb/data/WiredTiger +2 -0
- package/.mongodb/data/WiredTiger.lock +1 -0
- package/.mongodb/data/WiredTiger.turtle +6 -0
- package/.mongodb/data/WiredTiger.wt +0 -0
- package/.mongodb/data/WiredTigerHS.wt +0 -0
- package/.mongodb/data/_mdb_catalog.wt +0 -0
- package/.mongodb/data/_tmp/spilldb/WiredTiger +2 -0
- package/.mongodb/data/_tmp/spilldb/WiredTiger.lock +1 -0
- package/.mongodb/data/_tmp/spilldb/WiredTiger.turtle +6 -0
- package/.mongodb/data/_tmp/spilldb/WiredTiger.wt +0 -0
- package/.mongodb/data/_tmp/spilldb/WiredTigerHS.wt +0 -0
- package/.mongodb/data/collection-1237ee25-e684-403f-bdb3-fb55e1a25380.wt +0 -0
- package/.mongodb/data/collection-a0196e7a-9132-4312-9a86-df635b76fe5a.wt +0 -0
- package/.mongodb/data/collection-c3513e16-05f7-41e1-b848-24cddb0d0a86.wt +0 -0
- package/.mongodb/data/collection-f040076d-3cc0-47bb-b3a6-3312d2ccc43f.wt +0 -0
- package/.mongodb/data/diagnostic.data/metrics.2026-03-19T16-29-48Z-00000 +0 -0
- package/.mongodb/data/index-44edfeca-f3b5-4cd3-aafc-22f3542184a4.wt +0 -0
- package/.mongodb/data/index-6d021dfe-fda4-4697-9be3-00103bbb725d.wt +0 -0
- package/.mongodb/data/index-c3626b0b-158a-4bd2-a8b4-bf40a564d246.wt +0 -0
- package/.mongodb/data/index-c8044c91-407f-4533-8f20-5e40ee9625a4.wt +0 -0
- package/.mongodb/data/index-c8c851a7-6ef5-4d88-b8b4-7f1cc5244fc1.wt +0 -0
- package/.mongodb/data/journal/WiredTigerLog.0000000001 +0 -0
- package/.mongodb/data/journal/WiredTigerPreplog.0000000001 +0 -0
- package/.mongodb/data/mongod.lock +0 -0
- package/.mongodb/data/sizeStorer.wt +0 -0
- package/.mongodb/data/storage.bson +0 -0
- package/.mongodb/mongod.log +614 -0
- package/.mongodb/mongod.log.2026-03-19T16-29-48 +11 -0
- package/library-backend/package-lock.json +2057 -0
- package/library-backend/package.json +20 -0
- package/library-backend/public/asset-manifest.json +10 -0
- package/library-backend/public/index.html +1 -0
- package/library-backend/public/static/js/main.1e744c64.js +3 -0
- package/library-backend/public/static/js/main.1e744c64.js.LICENSE.txt +39 -0
- package/library-backend/public/static/js/main.1e744c64.js.map +1 -0
- package/library-backend/server.js +31 -0
- package/library-frontend/package-lock.json +17067 -0
- package/library-frontend/package.json +28 -0
- package/library-frontend/public/index.html +12 -0
- package/library-frontend/src/App.js +50 -0
- package/library-frontend/src/index.js +6 -0
- package/package.json +18 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "library-frontend",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"react": "^18.2.0",
|
|
7
|
+
"react-dom": "^18.2.0",
|
|
8
|
+
"react-scripts": "5.0.1",
|
|
9
|
+
"web-vitals": "^2.1.4"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "react-scripts start",
|
|
13
|
+
"build": "react-scripts build"
|
|
14
|
+
},
|
|
15
|
+
"proxy": "http://localhost:5000",
|
|
16
|
+
"browserslist": {
|
|
17
|
+
"production": [
|
|
18
|
+
">0.2%",
|
|
19
|
+
"not dead",
|
|
20
|
+
"not op_mini all"
|
|
21
|
+
],
|
|
22
|
+
"development": [
|
|
23
|
+
"last 1 chrome version",
|
|
24
|
+
"last 1 firefox version",
|
|
25
|
+
"last 1 safari version"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>📚 MERN Library</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
export default function App() {
|
|
4
|
+
const [books, setBooks] = useState([]);
|
|
5
|
+
const [title, setTitle] = useState('');
|
|
6
|
+
|
|
7
|
+
// fetch books
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
fetch('/api/books')
|
|
10
|
+
.then(res => res.json())
|
|
11
|
+
.then(setBooks);
|
|
12
|
+
}, []);
|
|
13
|
+
|
|
14
|
+
// add
|
|
15
|
+
const add = async () => {
|
|
16
|
+
await fetch('/api/books', {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
headers: { 'Content-Type': 'application/json' },
|
|
19
|
+
body: JSON.stringify({ title })
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
setTitle('');
|
|
23
|
+
const res = await fetch('/api/books');
|
|
24
|
+
setBooks(await res.json());
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// delete
|
|
28
|
+
const del = async (id) => {
|
|
29
|
+
await fetch('/api/books/' + id, { method: 'DELETE' });
|
|
30
|
+
setBooks(books.filter(b => b._id !== id));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div>
|
|
35
|
+
<h2>Library</h2>
|
|
36
|
+
|
|
37
|
+
<input value={title} onChange={e => setTitle(e.target.value)} />
|
|
38
|
+
<button onClick={add}>Add</button>
|
|
39
|
+
|
|
40
|
+
<ul>
|
|
41
|
+
{books.map(b => (
|
|
42
|
+
<li key={b._id}>
|
|
43
|
+
{b.title}
|
|
44
|
+
<button onClick={() => del(b._id)}>X</button>
|
|
45
|
+
</li>
|
|
46
|
+
))}
|
|
47
|
+
</ul>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mongodb241",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"install-all": "cd library-backend && npm install && cd ../library-frontend && npm install",
|
|
7
|
+
"start": "concurrently \"cd library-backend && node server.js\" \"cd library-frontend && npm start\""
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"concurrently": "^8.0.0"
|
|
11
|
+
},
|
|
12
|
+
"description": "",
|
|
13
|
+
"main": "index.js",
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"type": "commonjs"
|
|
18
|
+
}
|