Name: Shannen Lam
Date: April 9, 2019
Project Topic: Best Songs and Their Ratings
URL: https://crowd-sourced-song-recs.herokuapp.com/
Data point fields:
Field 1
: TitleType: String
Field 2
: Artist(s)Type: [String]
Field 3
: Genre(s)Type: [String]
Field 4
: LanguageType: String
Field 5
: Rate (out of 5)Type: Number
Schema:
{
title: String,
artists: [String],
genres: [String],
language: String,
suggested: Number,
rate: Number
}
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: "i'm so tired...",
artists:["Lauv","Troye Sivan"],
genres:["Pop"],
language:"English",
suggested: 1,
rate: 5
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
GET endpoint route: /api/getSongs
Search Field: Song title
Navigation Filters
- Best Songs ->
/bestsongs
- By Genre ->
/bygenre
- English Songs ->
/english
- Alphabetically ->
/alphabetical
- Random Rec ->
/randomrec