Name: Divya Gupta
Date: Nov 2, 2019
Project Topic: Website where users can upload playlists/information about playlists, and view which other playlists have been uploaded. The website displays a cover image to go along with the picture, as well as title, curator, number songs, and tags.
URL: https://playlist-forum.herokuapp.com/
Data point fields:
Field 1: TitleType: StringField 2: Link to PlaylistType: StringField 3: Number of SongsType: NumberField 4: TagsType: [String]Field 5: Artist Compilation?Type: BooleanField 6: CuratorType: StringField 6: Link to Cover (img)Type: String
Schema:
{
title: String,
link: String,
numSongs: Number,
tags: [String],
isArtistComp: Boolean,
curator: String,
cover: String
}HTML form route: /create
POST endpoint route: /api/create
Example Node.js POST request to endpoint:
var request = require("request");
var options = {
method: 'POST',
url: 'http://localhost:3000/api/create',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
form: {
title: "Chill",
link: "https://open.spotify.com/playlist/5CZM27oqcR8tZH2aTB04bi?si=9Vt2Xk84RKiqNn8aAL-Jzg",
numSongs: 71,
tags: [
"chill",
"mellow"
],
isArtistComp: false,
curator: "Divya Gupta",
cover: "https://f4.bcbits.com/img/a2170386826_10.jpg"
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});GET endpoint route: /api/getPlaylists
GET navigation filter endpoint routes:
/api/Mood,
/api/Mood/:subgroup,
/api/Artists,
/api/Length,
/api/Curator,
/api/Curator/:subgroup,
/api/Random
Search Field: title of playlist
GET search api: /search/:query
Navigation Filters
- Mood ->
/Mood - Artists ->
/Artists - Length ->
/Length - Curator ->
/Curator - Random ->
/Random