Skip to content

Commit 4fd02e4

Browse files
committed
updates
1 parent d3b6efd commit 4fd02e4

File tree

9 files changed

+56
-81
lines changed

9 files changed

+56
-81
lines changed

.DS_Store

0 Bytes
Binary file not shown.

db/db.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
[]
1+
[
2+
{
3+
"id": "358c",
4+
"title": "title",
5+
"text": "test"
6+
},
7+
{
8+
"id": "26fc",
9+
"title": "is this working",
10+
"text": "qsdf sdf s"
11+
}
12+
]

node_modules/.DS_Store

14 KB
Binary file not shown.

node_modules/iconv-lite/.DS_Store

6 KB
Binary file not shown.

node_modules/qs/.DS_Store

6 KB
Binary file not shown.

public/.DS_Store

6 KB
Binary file not shown.

public/assets/.DS_Store

6 KB
Binary file not shown.

public/notes.html

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
<!DOCTYPE html>
22
<html lang="en-US">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7-
<title>Note Taker</title>
8-
<link
9-
rel="stylesheet"
10-
href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/4.1.3/flatly/bootstrap.min.css"
11-
/>
12-
<link
13-
rel="stylesheet"
14-
href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
15-
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
16-
crossorigin="anonymous"
17-
/>
18-
<link rel="stylesheet" href="/assets/css/styles.css" />
19-
</head>
203

21-
<body>
22-
<nav class="navbar navbar-dark bg-dark">
23-
<a class="navbar-brand" href="/">Note Taker </a>
24-
<div class="icons">
25-
<i class="fas fa-save text-light save-note"></i>
26-
<i class="fas fa-plus text-light new-note"></i>
27-
</div>
28-
</nav>
29-
<div class="container-fluid">
30-
<div class="row">
31-
<div class="col-4 list-container">
32-
<div class="card">
33-
<ul class="list-group"></ul>
34-
</div>
35-
</div>
36-
<div class="col-8">
37-
<input
38-
class="note-title"
39-
placeholder="Note Title"
40-
maxlength="28"
41-
type="text"
42-
/>
43-
<textarea class="note-textarea" placeholder="Note Text"></textarea>
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
8+
<title>Note Taker</title>
9+
<link
10+
rel="stylesheet"
11+
href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/4.1.3/flatly/bootstrap.min.css" />
12+
<link
13+
rel="stylesheet"
14+
href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
15+
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
16+
crossorigin="anonymous" />
17+
<link rel="stylesheet" href="/assets/css/styles.css" />
18+
</head>
19+
20+
<body>
21+
<nav class="navbar navbar-dark bg-dark">
22+
<a class="navbar-brand" href="/">Note Taker </a>
23+
<div class="icons">
24+
<i class="fas fa-save text-light save-note"></i>
25+
<i class="fas fa-plus text-light new-note"></i>
26+
</div>
27+
</nav>
28+
<div class="container-fluid">
29+
<div class="row">
30+
<div class="col-4 list-container">
31+
<div class="card">
32+
<ul class="list-group"></ul>
33+
</div>
34+
</div>
35+
<div class="col-8">
36+
<input
37+
class="note-title"
38+
placeholder="Note Title"
39+
maxlength="28"
40+
type="text" />
41+
<textarea class="note-textarea" placeholder="Note Text"></textarea>
42+
</div>
43+
</div>
4444
</div>
45-
</div>
46-
</div>
47-
<script src="/assets/js/index.js"></script>
48-
</body>
45+
<script src="/assets/js/index.js"></script>
46+
</body>
47+
4948
</html>

server.js

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ app.use(express.static('public'));
2727
app.get('/', (req, res) =>
2828
res.sendFile(path.join(__dirname, '/public/index.html'))
2929
);
30-
// GET Route for homepage
30+
// GET Route for notes
3131
app.get('/notes', (req, res) =>
3232
res.sendFile(path.join(__dirname, '/public/notes.html'))
3333
);
@@ -91,41 +91,6 @@ app.post('/api/notes', (req, res) =>
9191
}
9292
});
9393

94-
95-
// DELETE request to delete a note
96-
// app.delete('/api/notes/:id', (req, res) =>
97-
// // Obtain existing notes
98-
// fs.readFile('./db/db.json', 'utf8', (err, data) =>
99-
// {
100-
// if (err) {
101-
// console.error(err);
102-
// } else {
103-
// const deletedNote = req.params.id;
104-
// // Convert string into JSON object
105-
// const parsedNote = JSON.parse(data);
106-
// console.log("deleted Note: ", deletedNote)
107-
// console.log("parsed Note: ", parsedNote)
108-
// console.log("db ", db)
109-
110-
// // remove the note from the array
111-
// for (var i = 0; i < db.length; i++){
112-
// if (db.id === deletedNote) {
113-
// db.splice(db[i], 1);
114-
// break
115-
// }
116-
// }
117-
// // Write updated notes back to the file
118-
// fs.writeFile(
119-
// './db/db.json',
120-
// JSON.stringify(db), (err, result) =>
121-
// res.json(db)
122-
123-
// );
124-
// }
125-
// }
126-
// ))
127-
128-
12994
// DELETE Route
13095
app.delete('/api/notes/:id', (req, res) =>
13196
{

0 commit comments

Comments
 (0)