-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
107 lines (67 loc) · 2.58 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
if i want pictures for tracks that's going to be an intense process of draggin along album JSON with me, figure out or drop column later
put in a 404 page with a link back to home page if there is an error
add ability to add a playlist at the screen where i choose a playlist to add a track to
how the hell do i get static js file to work for dom manip i feel like i'm close
weird bug where i can't delete a track? is it because of ridiculous, long, punctuation/heavy name? or a database issue
weird issue where if an artist does not have an image it will throw error
EXTRA:
for carousel, write code to convert integers into words
put some sound in there using Tone.js
try to incorporate both static and dynamic files
eventually get all these hefty spotify functions exported elsewhere to clean up code
issues with special characters in put/delete routes. do i need to encode them or something?
how do drop down menu? want to be able to select from several playlists
give ability to edit order of playlist
1. initialize npm, git
2. make gitignore with node_modules
3. make entry point file
4. set up express and home route to test
const express = require('express')
const app = express()
app.get('/', (req, res) =>{
res.send('express auth home route')
})
app.listen(8000, ()=>{
console.log('you\'re listening to the sweet sounds of port 8000')
})
5. create controllers and include this code in entry point:
app.use('/auth', require('./controllers/auth.js'))
6. in controller, require express, create a router
const router = express.Router()
and export that router
module.exports = router
7. make routes in controller
router.get('/login', (req, res) => {
res.send('GET /login successfully hit')
})
8. Set up views
npm i ejs express-ejs-layouts
const ejsLayouts = require('express-ejs-layouts')
app.set('view engine', 'ejs')
app.use(ejsLayouts)
9. Make layout.ejs, boilerplate, <%- body %>, etc
10. change any 'res.send' to res.render('with a file path here')
11. When making a form:
12. when retreiving post info, set up middleware
app.use(express.urlencoded({extended: false}))
13. Time for database:
install sequelize "npm i sequelize pg"
set up config file
sequelize db:create <name of database>
sequelzie model:create --name <> --attributes <>
sequelize db:migrate
check psql
14. require models wherever making routes and using sequelize functions
const db = require('../models')
-------------------
# To use this boilerplate
1. fork and clone
2. install dependencies
```
npm i
```
3. Create a config.json with the following code:
```
3. create database
```
sequelize db:create